function patCharactersticQRDA($xml, $patient_id) { //Patient History $patHist = patientQRDAHistory($patient_id); //Entry open $xml->open_entry(); //observation Open $xml->open_customTag('observation', array('classCode' => 'OBS', 'moodCode' => 'EVN')); $tempID = "2.16.840.1.113883.10.20.22.4.85"; $xml->self_templateid($tempID); $actId = getUuid(); $xml->self_customId($actId); $arr = array('code' => 'ASSERTION', 'displayName' => 'Assertion', 'codeSystem' => '2.16.840.1.113883.5.4', 'codeSystemName' => 'ActCode'); $xml->self_codeCustom($arr); $arr = array('code' => 'completed'); $xml->self_customTag('statusCode', $arr); $timeArr = array('low' => date('Ymdhis', strtotime($patHist['date'])), 'high' => date('Ymdhis', strtotime($patHist['date']))); $xml->add_entryEffectTime($timeArr); $xml->self_customTag('value', array('xsi:type' => 'CD', 'code' => '160603005', 'codeSystem' => '2.16.840.1.113883.6.96')); //observation Close $xml->close_customTag(); //Entry close $xml->close_entry(); }
function patCharactersticQRDA($xml, $patient_id) { //Patient History $patHist = patientQRDAHistory($patient_id); $tobaccoArr = explode('|', $patHist['tobacco']); $query = sqlQuery("select codes from list_options where list_id ='smoking_status' and option_id = ?", array($tobaccoArr[3])); $tobacco = explode(':', $query['codes']); $tobacco_code = $tobacco[1]; $vset = sqlQuery("select * from valueset where code = ? and nqf_code = ?", array($tobacco_code, $xml->nqf_code)); if (!empty($vset['valueset'])) { //Entry open $xml->open_entry(); //observation Open $xml->open_customTag('observation', array('classCode' => 'OBS', 'moodCode' => 'EVN')); $tempID = "2.16.840.1.113883.10.20.22.4.85"; $xml->self_templateid($tempID); $actId = getUuid(); $xml->self_customId($actId); $arr = array('code' => 'ASSERTION', 'displayName' => 'Assertion', 'codeSystem' => '2.16.840.1.113883.5.4', 'codeSystemName' => 'ActCode'); $xml->self_codeCustom($arr); $arr = array('code' => 'completed'); $xml->self_customTag('statusCode', $arr); $timeArr = array('low' => date('Ymdhis', strtotime($patHist['date'])), 'high' => date('Ymdhis', strtotime($patHist['date']))); $xml->add_entryEffectTime($timeArr); $xml->self_customTag('value', array('xsi:type' => 'CD', 'code' => $vset['code'], 'codeSystem' => $vset['code_system'], 'sdtc:valueSet' => $vset['valueset'])); //observation Close $xml->close_customTag(); //Entry close $xml->close_entry(); } }