Merge branch 'main' into zakaria
This commit is contained in:
commit
55f0a3cd2e
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,4 +3,5 @@
|
|||||||
!public/
|
!public/
|
||||||
!cretab.sql
|
!cretab.sql
|
||||||
!.gitignore
|
!.gitignore
|
||||||
|
!docs/
|
||||||
!env
|
!env
|
||||||
@ -6,5 +6,6 @@ use CodeIgniter\Router\RouteCollection;
|
|||||||
* @var RouteCollection $routes
|
* @var RouteCollection $routes
|
||||||
*/
|
*/
|
||||||
$routes->get('/', 'Pages::home');
|
$routes->get('/', 'Pages::home');
|
||||||
$routes->post('/api/requests/', 'API::requests');
|
$routes->post('/api/requests/', 'API_Requests::requests');
|
||||||
$routes->get('/api/results/(:any)', 'API::results/$1');
|
$routes->get('/api/requests/orm/(:any)', 'API_Requests::orm/$1');
|
||||||
|
$routes->get('/api/results/(:any)', 'API_Results::results/$1');
|
||||||
|
|||||||
280
app/Controllers/API_Requests.php
Normal file
280
app/Controllers/API_Requests.php
Normal file
@ -0,0 +1,280 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
use CodeIgniter\RESTful\ResourceController;
|
||||||
|
use CodeIgniter\I18n\Time;
|
||||||
|
|
||||||
|
class API_Requests extends ResourceController {
|
||||||
|
|
||||||
|
public function requests() {
|
||||||
|
$db = \Config\Database::connect();
|
||||||
|
$raw = $this->request->getVar();
|
||||||
|
|
||||||
|
// log to cm_tm_logs
|
||||||
|
$data = json_encode($raw);
|
||||||
|
$sql = "INSERT INTO cmod.dbo.CM_TM_LOGS (URL, METHOD, BODY, LOGDATE) VALUES ('API/REQUESTS', 'POST', '$data', GETDATE())";
|
||||||
|
$db->query($sql);
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
$qdata = (array)$raw;
|
||||||
|
$qpat = (array)$qdata['patient'];
|
||||||
|
|
||||||
|
//patdata
|
||||||
|
$rm = $qpat['rm_number'];
|
||||||
|
$firstname = $qpat['patient_first_name'];
|
||||||
|
$lastname = $qpat['patient_last_name'];
|
||||||
|
$dob = $qpat['patient_dob'];
|
||||||
|
$sex = $qpat['patient_sex'];
|
||||||
|
$phone = $qpat['patient_phone'];
|
||||||
|
|
||||||
|
$sql = "select PATID from cmod.dbo.CM_TM_PATIENTS where PATNUMBER='$rm'";
|
||||||
|
$query = $db->query($sql);
|
||||||
|
$results = $query->getResultArray();
|
||||||
|
if(!isset($results[0])) {
|
||||||
|
$sql = "INSERT INTO cmod.dbo.CM_TM_PATIENTS (PATNUMBER, FIRSTNAME, LASTNAME, BIRTHDATE, SEX, PHONE ) VALUES ('$rm', '$firstname', '$lastname', '$dob', '$sex', '$phone' )";
|
||||||
|
$db->query($sql);
|
||||||
|
$patid = $db->insertID();
|
||||||
|
} else {
|
||||||
|
$patid = $results[0]['PATID'];
|
||||||
|
$sql = "UPDATE cmod.dbo.CM_TM_PATIENTS SET FIRSTNAME='$firstname', LASTNAME='$lastname', BIRTHDATE='$dob', SEX='$sex', PHONE='$phone' where PATID='$patid'";
|
||||||
|
$db->query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
//reqdata
|
||||||
|
$reffid = $qdata['reference_id'];
|
||||||
|
$visitnum = $qpat['visit_number'];
|
||||||
|
$visitdesc = $qpat['visit_description'];
|
||||||
|
$visitdt = $qpat['visit_date_time'];
|
||||||
|
$agent = $qpat['agent'];
|
||||||
|
$agentname = $qpat['agent_name'];
|
||||||
|
$visittype = $qpat['visit_type'];
|
||||||
|
$company_name = $qdata['company_name'];
|
||||||
|
$loc = $qdata['branch'];
|
||||||
|
$doc = $qpat['treating_doctor'];
|
||||||
|
$createdt = $qdata['created'];
|
||||||
|
/*
|
||||||
|
$time = Time::createFromFormat('Y-m-d\TH:i:s.u\Z', $utcdt, 'UTC'); //2024-10-19T00:47:06.424654Z
|
||||||
|
$time = $time->setTimezone('Asia/Shanghai');
|
||||||
|
$orderdt = $time->toDateTimeString();
|
||||||
|
*/
|
||||||
|
$sql = "select REQID from cmod.dbo.CM_TM_REQUESTS where REFFID='$reffid'";
|
||||||
|
$query = $db->query($sql);
|
||||||
|
$results = $query->getResultArray();
|
||||||
|
if(!isset($results[0])) {
|
||||||
|
$sql = "INSERT INTO cmod.dbo.CM_TM_REQUESTS (REFFID, REQNUMBER, REQDESC, REQTYPE, REQDATE, AGENT, DOC, LOC, PATID, COMPANY, ISTAKEN, LOGDATE) VALUES ('$reffid', '$visitnum', '$visitdesc', '$visittype', '$visitdt', '$agentname', '$doc', '$loc', '$patid', '$company_name', null, '$createdt' )";
|
||||||
|
$db->query($sql);
|
||||||
|
$reqid = $db->insertID();
|
||||||
|
} else {
|
||||||
|
$reqid = $results[0]['REQID'];
|
||||||
|
$sql = "UPDATE cmod.dbo.CM_TM_REQUESTS SET REQNUMBER='$visitnum', REQDESC='$visitdesc', REQTYPE='$visittype', REQDATE='$visitdt', AGENT='$agentname', DOC='$doc', LOC='$loc', PATID='$patid' where REQID='$reqid'";
|
||||||
|
$db->query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
// tests
|
||||||
|
$tests = json_decode(json_encode($qpat['tests']), true);;
|
||||||
|
$string = '';
|
||||||
|
foreach($tests as $test) {
|
||||||
|
$testcode = $test['service_id'];
|
||||||
|
$testreffid = $test['test_ref_id'];
|
||||||
|
if(isset($test['status'])) { $teststatus = $test['status'];}
|
||||||
|
else { $teststatus = ''; }
|
||||||
|
$string .= "( '$testreffid', '$reqid', '$testcode', '$teststatus' ),";
|
||||||
|
}
|
||||||
|
$string = rtrim($string, ',');
|
||||||
|
//$sql = "INSERT INTO cmod.dbo.CM_TM_TESTS(REFFID, REQID, HISCODE) VALUES $string";
|
||||||
|
$sql = "INSERT INTO cmod.dbo.CM_TM_TESTS (REFFTESTID, REQID, HISCODE, TESTSTATUS)
|
||||||
|
SELECT S.REFFTESTID, S.REQID, S.HISCODE, S.TESTSTATUS FROM ( VALUES $string ) AS S (REFFTESTID, REQID, HISCODE, TESTSTATUS)
|
||||||
|
WHERE NOT EXISTS ( SELECT 1 FROM cmod.dbo.CM_TM_TESTS T WHERE T.REQID = S.REQID AND T.HISCODE = S.HISCODE );";
|
||||||
|
$db->query($sql);
|
||||||
|
|
||||||
|
$sql = "UPDATE cmod.dbo.CM_TM_TESTS SET TESTSTATUS = S.TESTSTATUS
|
||||||
|
FROM cmod.dbo.CM_TM_TESTS T
|
||||||
|
INNER JOIN ( VALUES $string ) AS S (REFFTESTID, REQID, HISCODE, TESTSTATUS)
|
||||||
|
ON T.REQID = S.REQID AND T.HISCODE = S.HISCODE;";
|
||||||
|
$db->query($sql);
|
||||||
|
|
||||||
|
|
||||||
|
return $this->respond(201);
|
||||||
|
/*
|
||||||
|
if( $db->query($sql) ) {
|
||||||
|
return $this->respond(201);
|
||||||
|
} else {
|
||||||
|
$response = [
|
||||||
|
'errors' => $db->errors(), 'message' => 'Invalid Messages'
|
||||||
|
];
|
||||||
|
return $this->fail($response , 409);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
public function orm($reqid) {
|
||||||
|
$db = \Config\Database::connect();
|
||||||
|
$sql = "select r.REFFID, r.LOC, p.PATNUMBER, p.FIRSTNAME, p.LASTNAME, p.BIRTHDATE, p.SEX, r.REQNUMBER, r.REQDATE, r.AGENT, r.DOC
|
||||||
|
from cmod.dbo.CM_TM_REQUESTS r
|
||||||
|
left join cmod.dbo.CM_TM_PATIENTS p on p.PATID=r.PATID
|
||||||
|
where r.REQID='$reqid'";
|
||||||
|
$query = $db->query($sql);
|
||||||
|
$results = $query->getResultArray();
|
||||||
|
$res = $results[0];
|
||||||
|
|
||||||
|
$reffid = $res['REFFID'];
|
||||||
|
$patnumber = $res['PATNUMBER'];
|
||||||
|
$loc = $res['LOC'];
|
||||||
|
$firstname = $res['FIRSTNAME'];
|
||||||
|
$lastname = $res['LASTNAME'];
|
||||||
|
$dob = $res['BIRTHDATE'];
|
||||||
|
$sex = $res['SEX'];
|
||||||
|
$hosp = $res['REQNUMBER'];
|
||||||
|
$reqdate = $res['REQDATE'];
|
||||||
|
$time = Time::createFromFormat('Y-m-d\TH:i:s.u\Z', $reqdate, 'UTC'); //2024-10-19T00:47:06.424654Z
|
||||||
|
// Denpasar
|
||||||
|
$time = $time->setTimezone('Asia/Shanghai');
|
||||||
|
$reqdate= date_format($time, 'YmdHi');
|
||||||
|
$agent = $res['AGENT'];
|
||||||
|
$doc = $res['DOC'];
|
||||||
|
$orm = "MSH|^~\&|PBMC|TM|TDNL||||ORM^O01^|||2.3||||\r";
|
||||||
|
$orm .= "PID|1||$patnumber^^^^PATNUMBER||$firstname^$lastname^^^^^L||$dob|$sex||^|^^||||||^||||||||||||||||\r";
|
||||||
|
$orm .= "PV1|||$loc^^^||||$doc|$doc||||||||||||||||||||||||||||||||||||$reqdate||||||||||\r";
|
||||||
|
#$orm +=
|
||||||
|
|
||||||
|
$sql = "select t.TESTSTATUS, m.LISCODE from cmod.dbo.CM_TM_TESTS t
|
||||||
|
left join cmod.dbo.CM_DICT_MAPPINGS m on m.HISCODE=t.HISCODE
|
||||||
|
where t.REQID='$reqid'";
|
||||||
|
$query = $db->query($sql);
|
||||||
|
$results = $query->getResultArray();
|
||||||
|
$i = 1;
|
||||||
|
foreach($results as $qdata) {
|
||||||
|
$liscode = $qdata['LISCODE'];
|
||||||
|
$status = $qdata['TESTSTATUS'];
|
||||||
|
if($liscode != '') {
|
||||||
|
if($status!=1 || $status !=2) {$status="NW";} else {$status="CA";}
|
||||||
|
$orm .= "ORC|$status|$reffid||$reffid|||^^^$reqdate|||||$loc|$doc||$reqdate|||||||||\r";
|
||||||
|
$orm .= "OBR|$i|||$liscode|||||||R|||$reqdate||$loc|||||||||||^^^^^R||||||||||||||\r";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<pre>$orm \r";
|
||||||
|
|
||||||
|
/*
|
||||||
|
MSH|^~\&|LISTHOST|LISTHOST.SEND|||202501171415||ORM^O01|01250101080|P|2.3
|
||||||
|
PID|||0111126100014955^^^^PATNUMBER||TJOENG VINCENTIUS MINARDI, MR^^^^^^L||19611211|M|||GRAHA FAMILY PP-9^^SURABAYA||0811300341^^TELEPHON~^^TELEPHON2~^^FAX~^^EMAIL^BERTINAMARTEN@GMAIL.COM|||||||||||||||||||
|
||||||
|
PV1|||WALK^2^^||||L0038|L0038||||||||||||||||||||||||||||||||||||202501171102||||||||||
|
||||||
|
ORC|CA|01250101080||01250101080|||^^^202501170000|||||L0038|WALK||202501171102|||||||||
|
||||||
|
OBR|1|||16549^^Konsultasi dr.Nunki|||||||R|||202501171102||L0038|||||||||||^^^^^R||||||||||||||
|
||||||
|
|
||||||
|
MSH|^~\&|RSML|HOST|TD-Synergy|202501201926|||ORM^O01||||||||||||
|
||||||
|
PID|||75.91.81^^^^PATNUMBER||Kasiyani Ny^^^^^^L||19480806|F|||Sumberwudi RT5 RW2 Sumberwudi Karanggeneng Lamonga^^^^^||^^~^^||||||||||||||
|
||||||
|
NTE|||Tamise Ny/Kardiyo Tn
|
||||||
|
PV1|||IGD||||1644||||||||||||2596973|||||||||||||||||||||||||202501201926||||||||
|
||||||
|
ORC|NW|||1319798|||^^^202501201926|||||1644|IGD||||202501201926||||||||
|
||||||
|
NTE|||-
|
||||||
|
NTE|||Candra Dewi K. dr. Sp.PK
|
||||||
|
NTE|||
|
||||||
|
OBR|1|||UREA||||||||||||||||||||||||||||||||||||
|
||||||
|
ORC|NW|||1319798|||^^^202501201926|||||1644|IGD||||202501201926||||||||
|
||||||
|
OBR|2|||CL||||||||||||||||||||||||||||||||||||
|
||||||
|
ORC|NW|||1319798|||^^^202501201926|||||1644|IGD||||202501201926||||||||
|
||||||
|
OBR|3|||AGDG||||||||||||||||||||||||||||||||||||
|
||||||
|
ORC|NW|||1319798|||^^^202501201926|||||1644|IGD||||202501201926||||||||
|
||||||
|
OBR|4|||GGPH||||||||||||||||||||||||||||||||||||
|
||||||
|
|
||||||
|
MSH|^~\&|PBMC|TM|TDNL||||ORM^O01^|||2.3||||
|
||||||
|
PID|1||^^^^PATNUMBER||^^^^^^L|||||^|^^||||||^||||||||||||||||
|
||||||
|
PV1|1||||||||||||||||||||||||||||||||||||||||||||
|
||||||
|
ORC|NW||||||^^^|||||||||||||
|
||||||
|
OBR|||||||||||||||||||||||||||^^^^^R|
|
||||||
|
|
||||||
|
var reqid = msg['reqid'].toString();
|
||||||
|
var reffid = msg['reffid'].toString();
|
||||||
|
var reqnumber = msg['reqnumber'].toString();
|
||||||
|
var patnumber = msg['patnumber'].toString();
|
||||||
|
var loc = msg['loc'].toString();
|
||||||
|
var doc = msg['doc'].toString();
|
||||||
|
var firstname = msg['firstname'].toString();
|
||||||
|
var lastname = msg['lastname'].toString();
|
||||||
|
var birthdate = msg['birthdate'].toString();
|
||||||
|
var sex = msg['sex'].toString();
|
||||||
|
sex = sex.substr(0,1);
|
||||||
|
var reqdate = msg['reqdate'].toString();
|
||||||
|
var agent = msg['agent'].toString();
|
||||||
|
|
||||||
|
curdate = DateUtil.getCurrentDate('yyyyMMddHHmm');
|
||||||
|
if(loc=='PBMC Bali') {
|
||||||
|
location = 'PADMA'; doctor='PBDPS';
|
||||||
|
} else {
|
||||||
|
location = 'PBSBY'; doctor='PBSBY';
|
||||||
|
curdate = curdate-100;
|
||||||
|
}
|
||||||
|
|
||||||
|
//DOB
|
||||||
|
var DOB = birthdate;
|
||||||
|
DOB=DOB.substr(0,4)+DOB.substr(5,2)+DOB.substr(8,2);
|
||||||
|
tmp['PID']['PID.7']['PID.7.1'] = DOB;
|
||||||
|
|
||||||
|
//ADT
|
||||||
|
tmp['MSH']['MSH.9']['MSH.9.1'] = 'ADT';
|
||||||
|
tmp['MSH']['MSH.9']['MSH.9.2'] = 'A08';
|
||||||
|
tmp['MSH']['MSH.7']['MSH.7.1'] = curdate;//timestamp
|
||||||
|
tmp['PV1']['PV1.44']['PV1.44.1'] = curdate;//admitdatetime
|
||||||
|
tmp['PID']['PID.3']['PID.3.1'] = patnumber;//patnum
|
||||||
|
tmp['PID']['PID.5']['PID.5.1'] = firstname;//firstname
|
||||||
|
tmp['PID']['PID.5']['PID.5.2'] = lastname;//lastname
|
||||||
|
tmp['PID']['PID.7']['PID.7.1'] = DOB;//Date of Birth
|
||||||
|
tmp['PID']['PID.8']['PID.8.1'] = sex.toUpperCase();//sex
|
||||||
|
|
||||||
|
tmp['PV1']['PV1.3']['PV1.3.1'] = location;//lokasi
|
||||||
|
tmp['PV1']['PV1.7']['PV1.7.1'] = doctor;//dokter
|
||||||
|
tmp['PV1']['PV1.8']['PV1.8.1'] = doctor;//dokter
|
||||||
|
tmp['PV1']['PV1.19']['PV1.19.1'] = reqnumber;
|
||||||
|
tmp['ORC']['ORC.2']['ORC.2.1'] = reffid;
|
||||||
|
tmp['ORC']['ORC.4']['ORC.4.1'] = reffid;
|
||||||
|
tmp['ORC']['ORC.7']['ORC.7.4'] = curdate;//coldatetime
|
||||||
|
tmp['ORC']['ORC.12']['ORC.12.1'] = doctor;//dokter
|
||||||
|
tmp['ORC']['ORC.13']['ORC.13.1'] = location;//lokasi
|
||||||
|
tmp['ORC']['ORC.15']['ORC.15.1'] = curdate;//timestamp
|
||||||
|
|
||||||
|
//var ADT = '<HL7Message>'+tmp['MSH']+tmp['PID']+tmp['PV1']+'</HL7Message>';
|
||||||
|
//logger.info(ADT);
|
||||||
|
//ADT = SerializerFactory.getSerializer('HL7V2').fromXML(ADT);
|
||||||
|
//channelMap.put('ADT',ADT);
|
||||||
|
|
||||||
|
//ORM
|
||||||
|
tmp['MSH']['MSH.9']['MSH.9.1'] = 'ORM';
|
||||||
|
tmp['MSH']['MSH.9']['MSH.9.2'] = 'O01';
|
||||||
|
tmp['MSH']['MSH.10']['MSH.10.1'] = reffid;
|
||||||
|
|
||||||
|
var sql = "select t.*, m.LISCODE from cmod.dbo.CM_TM_TESTS t"+
|
||||||
|
" left join cmod.dbo.CM_DICT_MAPPINGS m on m.HISCODE=t.HISCODE"+
|
||||||
|
" where t.REQID='"+reqid+"'";
|
||||||
|
var results = dbConn.executeCachedQuery(sql);
|
||||||
|
|
||||||
|
var i=0;
|
||||||
|
var obr = tmp['OBR'];
|
||||||
|
var orc = tmp['ORC'];
|
||||||
|
|
||||||
|
while(results.next()) {
|
||||||
|
var testcode=results.getString('LISCODE');
|
||||||
|
var status = results.getString('TESTSTATUS');
|
||||||
|
if(testcode != '' && testcode != null) {
|
||||||
|
tmp['ORC'][i]=orc;
|
||||||
|
if(status == '1' || status == '2') {
|
||||||
|
tmp['ORC'][i]['ORC.1']['ORC.1.1']="CA";
|
||||||
|
} else {
|
||||||
|
tmp['ORC'][i]['ORC.1']['ORC.1.1']="NW";
|
||||||
|
}
|
||||||
|
tmp['OBR'][i]=obr;
|
||||||
|
tmp['OBR'][i]['OBR.1']['OBR.1.1']=i+1;
|
||||||
|
tmp['OBR'][i]['OBR.4']['OBR.4.1']=testcode;
|
||||||
|
tmp['OBR'][i]['OBR.14']['OBR.14.1']=curdate;
|
||||||
|
tmp['OBR'][i]['OBR.16']['OBR.16.1']=doctor;
|
||||||
|
tmp['OBR'][i]['OBR.27']['OBR.27.6']='R';
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
110
app/Controllers/API_Results.php
Normal file
110
app/Controllers/API_Results.php
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
use CodeIgniter\RESTful\ResourceController;
|
||||||
|
use CodeIgniter\I18n\Time;
|
||||||
|
|
||||||
|
class API_Results extends ResourceController {
|
||||||
|
|
||||||
|
public function results($accessnumber) {
|
||||||
|
$db = \Config\Database::connect();
|
||||||
|
|
||||||
|
// $sql = "select HOSTORDERNUMBER as HISNO from SP_REQUESTS where SP_ACCESSNUMBER='$accessnumber'";
|
||||||
|
// $query = $db->query($sql);
|
||||||
|
// $results = $query->getResultArray();
|
||||||
|
// $data['LISNO'] = $accessnumber;
|
||||||
|
// $hisno = $results[0]['HISNO'];
|
||||||
|
// $sql = "select TESTCODE, TESTORDER, RESTYPE, RESVALUE, RESFLAG, UNIT, REFRANGE, USERVAL, RESDATE
|
||||||
|
// from cmod.dbo.CM_RESULTS r
|
||||||
|
// where ACCESSNUMBER='$accessnumber'
|
||||||
|
// order by TESTORDER";
|
||||||
|
// $query = $db->query($sql);
|
||||||
|
// $results = $query->getResultArray();
|
||||||
|
|
||||||
|
$sql = "SELECT sp.HOSTORDERNUMBER, hiso.LOC, hiso.PAYERNAME
|
||||||
|
FROM dbo.SP_REQUESTS sp
|
||||||
|
LEFT JOIN cmod.dbo.CM_HIS_ORDERS hiso ON hiso.VISITNUMBER = sp.HOSTORDERNUMBER
|
||||||
|
WHERE SP_ACCESSNUMBER = '$accessnumber'";
|
||||||
|
$query = $db->query($sql);
|
||||||
|
$results = $query->getResultArray();
|
||||||
|
|
||||||
|
$location = $results[0]['LOC'] == null ? 'PBMC Bali' : 'PBMC Surabaya';
|
||||||
|
$payer_name = $results[0]['PAYERNAME'] == null ? '' : $results[0]['PAYERNAME'];
|
||||||
|
|
||||||
|
$sql = "select
|
||||||
|
dc.CHAPID,
|
||||||
|
dc.FULLTEXT as chap_eng,
|
||||||
|
dc.FULLTEXT as chap_ind,
|
||||||
|
st.FULLTEXT as serum_type,
|
||||||
|
cdt.TEXT1 as test_eng,
|
||||||
|
cdt.TEXT2 as test_ind,
|
||||||
|
cdt.UNIT as UNITTEXT,
|
||||||
|
cdt.REFFTEXT,
|
||||||
|
t.DEPTH as text_depth,
|
||||||
|
t.NOTPRINTABLE,
|
||||||
|
t.TESTORDER,
|
||||||
|
t.RESTYPE as code_type,
|
||||||
|
t.VALIDATIONINITIALS as validator,
|
||||||
|
dt.SHORTTEXT,
|
||||||
|
RESULT = case when t.RESVALUE is null then tx.FULLTEXT else t.RESVALUE end,
|
||||||
|
cr.*
|
||||||
|
from REQUESTS r
|
||||||
|
left join TESTS t on t.REQUESTID = r.REQUESTID
|
||||||
|
left join DICT_TESTS dt on dt.ENDVALIDDATE is null and t.TESTID=dt.TESTID
|
||||||
|
left join DICT_TEXTS tx on tx.TEXTID=t.CODEDRESULTID
|
||||||
|
left join DICT_CHAPTERS dc on dc.CHAPID=dt.CHAPID and dc.ENDVALIDDATE is null
|
||||||
|
left join DICT_TEST_SAMPLES ts on ts.TESTID=t.TESTID and dt.TESTID=ts.TESTID
|
||||||
|
left join DICT_SAMPLES_TYPES st on st.SAMPTYPEID=ts.SAMPTYPEID
|
||||||
|
left join cmod.dbo.CM_DICT_TESTS cdt on dt.TESTCODE=cdt.TESTCODE
|
||||||
|
left join cmod.dbo.CM_RESULTS cr on cr.ACCESSNUMBER=r.ACCESSNUMBER and cr.TESTCODE=cdt.TESTCODE and cr.TESTCODE=dt.TESTCODE
|
||||||
|
where r.ACCESSNUMBER='$accessnumber'
|
||||||
|
ORDER BY t.TESTORDER";
|
||||||
|
$query = $db->query($sql);
|
||||||
|
$test_results = $query->getResultArray();
|
||||||
|
|
||||||
|
// $uuid24 = $this->generateUUID24();
|
||||||
|
$response = [
|
||||||
|
"headers" => [
|
||||||
|
"Content-Type" => "application/json",
|
||||||
|
"Authorization" => "Transmedic api key"
|
||||||
|
],
|
||||||
|
"data" => [
|
||||||
|
"reference_id" => "",
|
||||||
|
"created" => "2024-10-19T02:11:06.424654Z",
|
||||||
|
"company_name" => $payer_name,
|
||||||
|
"branch" => $location,
|
||||||
|
"test_results" => []
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
// Digunakan Untuk Hasil test
|
||||||
|
foreach ($test_results as $result) {
|
||||||
|
|
||||||
|
// var_dump($result);die();
|
||||||
|
|
||||||
|
if ($result['text_depth'] == 0) {
|
||||||
|
// $uuid32 = $this->generateUUID32();
|
||||||
|
$uuid24 = $this->generateUUID24();
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
"test_ref_id"=> $uuid24,
|
||||||
|
"service_id"=> "",
|
||||||
|
"service_name"=> $result['test_eng'],
|
||||||
|
"test_medium"=> $result['serum_type'],
|
||||||
|
"test_container"=> "",
|
||||||
|
"chapter_type"=> $result['chap_eng'],
|
||||||
|
"test_summary"=> "",
|
||||||
|
"status"=> "",
|
||||||
|
];
|
||||||
|
|
||||||
|
array_push($response['data']['test_results'], $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->respond($response,200);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
11
app/Controllers/Home.php
Normal file
11
app/Controllers/Home.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
class Home extends BaseController
|
||||||
|
{
|
||||||
|
public function index(): string
|
||||||
|
{
|
||||||
|
return view('welcome_message');
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
docs/INST002.pdf
Normal file
BIN
docs/INST002.pdf
Normal file
Binary file not shown.
BIN
docs/INST003.pdf
Normal file
BIN
docs/INST003.pdf
Normal file
Binary file not shown.
69
env
Normal file
69
env
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
#--------------------------------------------------------------------
|
||||||
|
# Example Environment Configuration file
|
||||||
|
#
|
||||||
|
# This file can be used as a starting point for your own
|
||||||
|
# custom .env files, and contains most of the possible settings
|
||||||
|
# available in a default install.
|
||||||
|
#
|
||||||
|
# By default, all of the settings are commented out. If you want
|
||||||
|
# to override the setting, you must un-comment it by removing the '#'
|
||||||
|
# at the beginning of the line.
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# ENVIRONMENT
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
|
# CI_ENVIRONMENT = production
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# APP
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
|
# app.baseURL = ''
|
||||||
|
# If you have trouble with `.`, you could also use `_`.
|
||||||
|
# app_baseURL = ''
|
||||||
|
# app.forceGlobalSecureRequests = false
|
||||||
|
# app.CSPEnabled = false
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# DATABASE
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
|
# database.default.hostname = localhost
|
||||||
|
# database.default.database = ci4
|
||||||
|
# database.default.username = root
|
||||||
|
# database.default.password = root
|
||||||
|
# database.default.DBDriver = MySQLi
|
||||||
|
# database.default.DBPrefix =
|
||||||
|
# database.default.port = 3306
|
||||||
|
|
||||||
|
# If you use MySQLi as tests, first update the values of Config\Database::$tests.
|
||||||
|
# database.tests.hostname = localhost
|
||||||
|
# database.tests.database = ci4_test
|
||||||
|
# database.tests.username = root
|
||||||
|
# database.tests.password = root
|
||||||
|
# database.tests.DBDriver = MySQLi
|
||||||
|
# database.tests.DBPrefix =
|
||||||
|
# database.tests.charset = utf8mb4
|
||||||
|
# database.tests.DBCollat = utf8mb4_general_ci
|
||||||
|
# database.tests.port = 3306
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# ENCRYPTION
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
|
# encryption.key =
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# SESSION
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
|
# session.driver = 'CodeIgniter\Session\Handlers\FileHandler'
|
||||||
|
# session.savePath = null
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# LOGGER
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
|
# logger.threshold = 4
|
||||||
@ -14,7 +14,6 @@ Options -Indexes
|
|||||||
# If you installed CodeIgniter in a subfolder, you will need to
|
# If you installed CodeIgniter in a subfolder, you will need to
|
||||||
# change the following line to match the subfolder you need.
|
# change the following line to match the subfolder you need.
|
||||||
# http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
|
# http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
|
||||||
# RewriteBase /
|
|
||||||
|
|
||||||
# Redirect Trailing Slashes...
|
# Redirect Trailing Slashes...
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
@ -35,7 +34,6 @@ Options -Indexes
|
|||||||
|
|
||||||
# Ensure Authorization header is passed along
|
# Ensure Authorization header is passed along
|
||||||
RewriteCond %{HTTP:Authorization} .
|
RewriteCond %{HTTP:Authorization} .
|
||||||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
<IfModule !mod_rewrite.c>
|
<IfModule !mod_rewrite.c>
|
||||||
|
|||||||
33
public/web.config
Normal file
33
public/web.config
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<system.webServer>
|
||||||
|
<rewrite>
|
||||||
|
<rules>
|
||||||
|
<rule name="Imported Rule 1" stopProcessing="true">
|
||||||
|
<match url="^" ignoreCase="false" />
|
||||||
|
<conditions logicalGrouping="MatchAll">
|
||||||
|
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
|
||||||
|
<add input="{URL}" pattern="(.+)/$" ignoreCase="false" />
|
||||||
|
</conditions>
|
||||||
|
<action type="Redirect" url="{C:1}" redirectType="Permanent" />
|
||||||
|
</rule>
|
||||||
|
<rule name="Imported Rule 2" stopProcessing="true">
|
||||||
|
<match url="^" ignoreCase="false" />
|
||||||
|
<conditions logicalGrouping="MatchAll">
|
||||||
|
<add input="{HTTPS}" pattern="^on$" ignoreCase="false" negate="true" />
|
||||||
|
<add input="{HTTP_HOST}" pattern="^www\.(.+)$" />
|
||||||
|
</conditions>
|
||||||
|
<action type="Redirect" url="http://{C:1}{URL}" redirectType="Permanent" />
|
||||||
|
</rule>
|
||||||
|
<rule name="Imported Rule 3" stopProcessing="true">
|
||||||
|
<match url="^([\s\S]*)$" />
|
||||||
|
<conditions logicalGrouping="MatchAll">
|
||||||
|
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
|
||||||
|
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
|
||||||
|
</conditions>
|
||||||
|
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
|
||||||
|
</rule>
|
||||||
|
</rules>
|
||||||
|
</rewrite>
|
||||||
|
</system.webServer>
|
||||||
|
</configuration>
|
||||||
Loading…
x
Reference in New Issue
Block a user