Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

64 loinc terminology #65

Merged
merged 6 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/satusehatintegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
*/
'log_table_name' => 'satusehat_log',
'token_table_name' => 'satusehat_token',

'icd10_table_name' => 'satusehat_icd10',
'icd9cm_table_name' => 'satusehat_icd9cm',

'loinc_table_name' => 'satusehat_loinc',
'loinc_answer_table_name' => 'satusehat_loinc_answer',

'kode_wilayah_indonesia_table_name' => 'kode_wilayah_indonesia',

/*
Expand Down
41 changes: 41 additions & 0 deletions database/migrations/create_satusehat_loinc_answer_table.php.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSatusehatLoincTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection(config('satusehatintegration.database_connection_master'))->create(config('satusehatintegration.loinc_answer_table_name'), function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('LoincNumber')->nullable();
$table->string('AnswerListId')->nullable();
$table->string('AnswerListName')->nullable();
$table->string('AnswerStringId')->nullable();
$table->integer('SequenceNumber')->nullable();
$table->string('DisplayText')->nullable();
$table->string('ExtCodeId')->nullable();
$table->string('ExtCodeDisplayName')->nullable();
$table->string('ExtCodeSystem')->nullable();
$table->timestamps();
$table->softDeletes();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection(config('satusehatintegration.database_connection_master'))->dropIfExists(config('satusehatintegration.loinc_answer_table_name'));
}
}
47 changes: 47 additions & 0 deletions database/migrations/create_satusehat_loinc_table.php.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSatusehatLoincTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection(config('satusehatintegration.database_connection_master'))->create(config('satusehatintegration.loinc_table_name'), function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('LOINC_NUM')->unique();
$table->string('COMPONENT')->nullable();
$table->string('PROPERTY')->nullable();
$table->string('TIME_ASPCT')->nullable();
$table->string('SYSTEM')->nullable();
$table->string('SCALE_TYP')->nullable();
$table->string('METHOD_TYP')->nullable();
$table->string('CLASS')->nullable();
$table->string('CLASSTYPE')->nullable();
$table->string('LONG_COMMON_NAME')->nullable();
$table->string('SHORTNAME')->nullable();
$table->longText('EXTERNAL_COPYRIGHT_NOTICE')->nullable();
$table->string('STATUS')->nullable();
$table->string('VersionFirstReleased')->nullable();
$table->string('VersionLastChanged')->nullable();
$table->timestamps();
$table->softDeletes();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection(config('satusehatintegration.database_connection_master'))->dropIfExists(config('satusehatintegration.loinc_table_name'));
}
}
27 changes: 27 additions & 0 deletions database/seeders/LoincAnswerSeeder.php.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
namespace Database\Seeders;

use JeroenZwart\CsvSeeder\CsvSeeder;
use DB;

class LoincAnswerSeeder extends CsvSeeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function __construct(){
$this->file = base_path().'/database/seeders/csv/loinc_answer.csv';
$this->tablename = config('satusehatintegration.loinc_answer_table_name');
$this->delimiter = ';';
}

public function run()
{
// Recommended when importing larger CSVs
DB::disableQueryLog();

parent::run();
}
}
27 changes: 27 additions & 0 deletions database/seeders/LoincSeeder.php.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
namespace Database\Seeders;

use JeroenZwart\CsvSeeder\CsvSeeder;
use DB;

class LoincSeeder extends CsvSeeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function __construct(){
$this->file = base_path().'/database/seeders/csv/loinc.csv';
$this->tablename = config('satusehatintegration.loinc_table_name');
$this->delimiter = ';';
}

public function run()
{
// Recommended when importing larger CSVs
DB::disableQueryLog();

parent::run();
}
}
Loading