Skip to content

Commit

Permalink
Merge pull request #65 from ivanwilliammd/64-loinc-terminology
Browse files Browse the repository at this point in the history
64 loinc terminology
  • Loading branch information
ivanwilliammd authored Nov 29, 2024
2 parents fe8c571 + e143314 commit 18b8ae3
Show file tree
Hide file tree
Showing 11 changed files with 226,470 additions and 1 deletion.
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

0 comments on commit 18b8ae3

Please sign in to comment.