$param->parent_id = $pid; $patientResult = $Medical->getPatientLabsResults($param); $results[] = array(); foreach ($patientResult as $item) { $results[] = array('Result' => array(array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => $item['observation_value'], 'Code' => array('Value' => $item['observation_loinc'], 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'Test' => array(array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'HGB', 'Code' => array('Value' => '30313-1', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => '13.2', 'Units' => array('Unit' => 'g/dl')), 'NormalResult' => array('Normal' => array(array('Description' => array('Text' => 'M 13-18 g/dl; F 12-16 g/dl', 'Source' => array('Actor' => array('ActorID' => $softwareGUID))))))))))); } /** * Vital Signs section - (SHALL) * ------------------- * This section contains current and historically relevant vital signs, such as blood pressure, heart rate, * respiratory rate, height, weight, body mass index, head circumference, crown-to-rump length, and pulse * oximetry. The section may contain all vital signs for the period of time being summarized, but at a * minimum should include notable vital signs such as the most recent, maximum and/or minimum, or both, * baseline, or relevant trends. */ $vitalSigns = $Encounter->getVitalsByPid($pid); $vitals = array(); foreach ($vitalSigns as $item) { $vitals[] = array('Result' => array(array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Type' => array('Text' => 'Vital Signs', 'Code' => array('Value' => '8716-3', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'Test' => array(array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Body height', 'Code' => array('Value' => '3138-5', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['height_in'], 'Units' => array('Unit' => 'in'))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Body height', 'Code' => array('Value' => '3138-5', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['height_cm'], 'Units' => array('Unit' => 'cm'))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Systolic BP', 'Code' => array('Value' => '8480-6', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['bp_systolic'], 'Units' => array('Unit' => 'mm Hg'))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Diastolic BP', 'Code' => array('Value' => '20184-8', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['bp_diastolic'], 'Units' => array('Unit' => 'mm Hg'))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Body weight', 'Code' => array('Value' => '3141-9', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['weight_lbs'], 'Units' => array('Unit' => 'Lbs'))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Body weight', 'Code' => array('Value' => '3141-9', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['weight_kg'], 'Units' => array('Unit' => 'Kg'))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Pulse', 'Code' => array('Value' => '44974-4', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['pulse'], 'Units' => array('Unit' => 'Kg'))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Respiration', 'Code' => array('Value' => '28333-3', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['respiration'], 'Units' => array('Unit' => ''))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Temperature', 'Code' => array('Value' => '8310-5', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['temp_f'], 'Units' => array('Unit' => 'F'))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Temperature', 'Code' => array('Value' => '8310-5', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['temp_c'], 'Units' => array('Unit' => 'C'))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Oxygen saturation', 'Code' => array('Value' => '20564-1', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['oxygen_saturation'], 'Units' => array('Unit' => '%'))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Head circumference', 'Code' => array('Value' => '11986-7', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['head_circumference_cm'], 'Units' => array('Unit' => 'cm'))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'Waist circumference', 'Code' => array('Value' => '8280-0', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['waist_circumference_cm'], 'Units' => array('Unit' => 'cm'))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Assessment Time'), 'ExactDateTime' => date("Y-m-d", strtotime($item['date']))), 'Description' => array('Text' => 'BMI', 'Code' => array('Value' => '59574-4', 'CodingSystem' => 'LOINC')), 'Status' => array('Text' => 'Final Results'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'TestResult' => array('Value' => $item['bmi'], 'Units' => array('Unit' => '%'))))))); } /** * Immunizations section - (SHALL) * --------------------- * The Immunizations section defines a patient’s current immunization status and pertinent immunization * history. The primary use case for the Immunization section is to enable communication of a patient’s * immunization status. The section should include current immunization status, and may contain the entire * immunization history that is relevant to the period of time being summarized. */ $param = new stdClass(); $param->pid = $pid; $patientImmunizations = $Medical->getPatientImmunizations($param);