do { $e_Result = $ccr->createElement('Result'); $e_Results->appendChild($e_Result); $e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', getUuid()); //, $row['immunization_id']); $e_Result->appendChild($e_CCRDataObjectID); $e_DateTime = $ccr->createElement('DateTime'); $e_Result->appendChild($e_DateTime); $date = date_create($row['date']); $e_ExactDateTime = $ccr->createElement('ExactDateTime', $date->format('Y-m-d\\TH:i:s\\Z')); $e_DateTime->appendChild($e_ExactDateTime); $e_IDs = $ccr->createElement('IDs'); $e_Result->appendChild($e_IDs); $e_ID = $ccr->createElement('ID'); $e_IDs->appendChild($e_ID); $e_IDs->appendChild(sourceType($ccr, $authorID)); $e_Source = $ccr->createElement('Source'); $e_Result->appendChild($e_Source); $e_Actor = $ccr->createElement('Actor'); $e_Source->appendChild($e_Actor); $e_ActorID = $ccr->createElement('ActorID', $uuid); //$e_ActorID = $ccr->createElement('ActorID',${"labID{$row['lab']}"}); $e_Actor->appendChild($e_ActorID); $e_Test = $ccr->createElement('Test'); $e_Result->appendChild($e_Test); $e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', getUuid()); $e_Test->appendChild($e_CCRDataObjectID); $e_DateTime = $ccr->createElement('DateTime'); $e_Test->appendChild($e_DateTime); $e_ExactDateTime = $ccr->createElement('ExactDateTime', $date->format('Y-m-d\\TH:i:s\\Z')); $e_DateTime->appendChild($e_ExactDateTime);
$e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', getUuid()); $e_Medication->appendChild($e_CCRDataObjectID); $e_DateTime = $ccr->createElement('DateTime'); $e_Medication->appendChild($e_DateTime); $date = date_create($value['date_added']); $e_ExactDateTime = $ccr->createElement('ExactDateTime', $date->format('Y-m-d\\TH:i:s\\Z')); $e_DateTime->appendChild($e_ExactDateTime); $e_Type = $ccr->createElement('Type'); $e_Medication->appendChild($e_Type); $e_Text = $ccr->createElement('Text', 'Medication'); $e_Type->appendChild($e_Text); $e_Status = $ccr->createElement('Status'); $e_Medication->appendChild($e_Status); $e_Text = $ccr->createElement('Text', $value['active']); $e_Status->appendChild($e_Text); $e_Medication->appendChild(sourceType($ccr, $sourceID)); $e_Product = $ccr->createElement('Product'); $e_Medication->appendChild($e_Product); $e_ProductName = $ccr->createElement('ProductName'); $e_Product->appendChild($e_ProductName); $e_Text = $ccr->createElement('Text', $value['drug']); $e_ProductName->appendChild(clone $e_Text); $e_Code = $ccr->createElement('Code'); $e_ProductName->appendChild($e_Code); $e_Value = $ccr->createElement('Value', $value['rxnorm_drugcode']); $e_Code->appendChild($e_Value); $e_Value = $ccr->createElement('CodingSystem', 'RxNorm'); $e_Code->appendChild($e_Value); $e_Strength = $ccr->createElement('Strength'); $e_Product->appendChild($e_Strength); $e_Value = $ccr->createElement('Value', $value['size']);
$e_EnvironmentalAgent->appendChild($e_CCRDataObjectID); $e_DateTime = $ccr->createElement('DateTime'); $e_EnvironmentalAgent->appendChild($e_DateTime); $e_ExactDateTime = $ccr->createElement('ExactDateTime', $row['date']); $e_DateTime->appendChild($e_ExactDateTime); $e_Description = $ccr->createElement('Description'); $e_EnvironmentalAgent->appendChild($e_Description); $e_Text = $ccr->createElement('Text', $row['alert_title']); $e_Description->appendChild($e_Text); $e_Code = $ccr->createElement('Code'); $e_Description->appendChild($e_Code); $e_Value = $ccr->createElement('Value'); //,$row['codetext'] $e_Code->appendChild($e_Value); $e_Status = $ccr->createElement('Status'); $e_EnvironmentalAgent->appendChild($e_Status); $e_Text = $ccr->createElement('Text', $row['outcome']); $e_Status->appendChild($e_Text); $e_EnvironmentalAgent->appendChild(sourceType($ccr, $sourceID)); $e_Reaction = $ccr->createElement('Reaction'); $e_Alert->appendChild($e_Reaction); $e_Description = $ccr->createElement('Description'); $e_Reaction->appendChild($e_Description); $e_Text = $ccr->createElement('Text', $row['reaction']); $e_Description->appendChild($e_Text); $e_Status = $ccr->createElement('Status'); $e_Reaction->appendChild($e_Status); $e_Text = $ccr->createElement('Text', 'None'); $e_Status->appendChild($e_Text); } while ($row = sqlFetchArray($result)); //}
$e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', getUuid()); $e_Immunization->appendChild($e_CCRDataObjectID); $e_DateTime = $ccr->createElement('DateTime'); $e_Immunization->appendChild($e_DateTime); $date = date_create($row['administered_date']); $e_ExactDateTime = $ccr->createElement('ExactDateTime', $date->format('Y-m-d\\TH:i:s\\Z')); $e_DateTime->appendChild($e_ExactDateTime); $e_Type = $ccr->createElement('Type'); $e_Immunization->appendChild($e_Type); $e_Text = $ccr->createElement('Text', 'Immunization'); $e_Type->appendChild($e_Text); $e_Status = $ccr->createElement('Status'); $e_Immunization->appendChild($e_Status); $e_Text = $ccr->createElement('Text', 'ACTIVE'); $e_Status->appendChild($e_Text); $e_Immunization->appendChild(sourceType($ccr, $authorID)); $e_Product = $ccr->createElement('Product'); $e_Immunization->appendChild($e_Product); $e_ProductName = $ccr->createElement('ProductName'); $e_Product->appendChild($e_ProductName); $e_Text = $ccr->createElement('Text', $row['title']); $e_ProductName->appendChild($e_Text); $e_Directions = $ccr->createElement('Directions'); $e_Immunization->appendChild($e_Directions); $e_Direction = $ccr->createElement('Direction'); $e_Directions->appendChild($e_Direction); $e_Description = $ccr->createElement('Description'); $e_Direction->appendChild($e_Description); $e_Text = $ccr->createElement('Text', $row['note']); $e_Description->appendChild($e_Text); $e_Code = $ccr->createElement('Code');
$e_Type->appendChild($e_Text); $e_Description = $ccr->createElement('Description'); $e_Procedure->appendChild($e_Description); $e_Text = $ccr->createElement('Text', $row['proc_title']); $e_Description->appendChild($e_Text); $e_Code = $ccr->createElement('Code'); $e_Description->appendChild($e_Code); $e_Value = $ccr->createElement('Value', $row['code']); $e_Code->appendChild($e_Value); $e_Value = $ccr->createElement('CodingSystem', $row['coding']); $e_Code->appendChild($e_Value); $e_Status = $ccr->createElement('Status'); $e_Procedure->appendChild($e_Status); $e_Text = $ccr->createElement('Text', $row['outcome']); $e_Status->appendChild($e_Text); $e_Procedure->appendChild(sourceType($ccr, $sourceID)); $e_Locations = $ccr->createElement('Locations'); $e_Procedure->appendChild($e_Locations); $e_Location = $ccr->createElement('Location'); $e_Locations->appendChild($e_Location); $e_Description = $ccr->createElement('Description'); $e_Location->appendChild($e_Description); $e_Text = $ccr->createElement('Text', $row['laterality']); $e_Description->appendChild($e_Text); $e_Practitioners = $ccr->createElement('Practitioners'); $e_Procedure->appendChild($e_Practitioners); $e_Practitioner = $ccr->createElement('Practitioner'); $e_Practitioners->appendChild($e_Practitioner); $e_ActorRole = $ccr->createElement('ActorRole'); $e_Practitioner->appendChild($e_ActorRole); $e_Text = $ccr->createElement('Text', 'None');
$e_Episodes->appendChild($e_Episode); $e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', 'EP' . $pCount); $e_Episode->appendChild($e_CCRDataObjectID); $e_Episode->appendChild(sourceType($ccr, $sourceID)); $e_Episodes->appendChild(sourceType($ccr, $sourceID)); $e_HealthStatus = $ccr->createElement('HealthStatus'); $e_Problem->appendChild($e_HealthStatus); $e_DateTime = $ccr->createElement('DateTime'); $e_HealthStatus->appendChild($e_DateTime); $e_ExactDateTime = $ccr->createElement('ExactDateTime'); $e_DateTime->appendChild($e_ExactDateTime); $e_Description = $ccr->createElement('Description'); $e_HealthStatus->appendChild($e_Description); $e_Text = $ccr->createElement('Text', $row['reason']); $e_Description->appendChild($e_Text); $e_HealthStatus->appendChild(sourceType($ccr, $sourceID)); } while ($row = sqlFetchArray($result)); //} // complex type should go in different find and should be included in createCCR.php /* function sourceType($ccr, $uuid){ $e_Source = $ccr->createElement('Source'); $e_Actor = $ccr->createElement('Actor'); $e_Source->appendChild($e_Actor); $e_ActorID = $ccr->createElement('ActorID',$uuid); $e_Actor->appendChild($e_ActorID); return $e_Source;
$e_DateTime = $ccr->createElement('DateTime'); $e_Medication->appendChild($e_DateTime); $date = date_create($value['date_added']); $e_ExactDateTime = $ccr->createElement('ExactDateTime', $date->format('Y-m-d\\TH:i:s\\Z')); $e_DateTime->appendChild($e_ExactDateTime); $e_Type = $ccr->createElement('Type'); $e_Medication->appendChild($e_Type); // $e_Text = $ccr->createElement('Text', $value['medication']); $e_Text = $ccr->createElement('Text', 'Medication'); $e_Type->appendChild($e_Text); $e_Status = $ccr->createElement('Status'); $e_Medication->appendChild($e_Status); // $e_Text = $ccr->createElement('Text',$value['active']); $e_Text = $ccr->createElement('Text', 'Active'); $e_Status->appendChild($e_Text); $e_Medication->appendChild(sourceType($ccr, $authorID)); $e_Product = $ccr->createElement('Product'); $e_Medication->appendChild($e_Product); $e_ProductName = $ccr->createElement('ProductName'); $e_Product->appendChild($e_ProductName); $e_Text = $ccr->createElement('Text', $value['drug']); $e_ProductName->appendChild(clone $e_Text); $e_Form = $ccr->createElement('Form'); $e_Product->appendChild($e_Form); $e_Text = $ccr->createElement('Text', 'Tablets'); $e_Form->appendChild($e_Text); $e_Strength = $ccr->createElement('Strength'); $e_Product->appendChild($e_Strength); $e_Value = $ccr->createElement('Value'); $e_Strength->appendChild($e_Value); $e_Text = $ccr->createElement('Text', '100');
$e_Episodes->appendChild($e_Episode); $e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', 'EP' . $pCount); $e_Episode->appendChild($e_CCRDataObjectID); $e_Episode->appendChild(sourceType($ccr, $authorID)); $e_Episodes->appendChild(sourceType($ccr, $authorID)); $e_HealthStatus = $ccr->createElement('HealthStatus'); $e_Problem->appendChild($e_HealthStatus); $e_DateTime = $ccr->createElement('DateTime'); $e_HealthStatus->appendChild($e_DateTime); $e_ExactDateTime = $ccr->createElement('ExactDateTime'); $e_DateTime->appendChild($e_ExactDateTime); $e_Description = $ccr->createElement('Description'); $e_HealthStatus->appendChild($e_Description); $e_Text = $ccr->createElement('Text', $row['reason']); $e_Description->appendChild($e_Text); $e_HealthStatus->appendChild(sourceType($ccr, $authorID)); } while ($row = sqlFetchArray($result)); //} // complex type should go in different find and should be included in createCCR.php /* function sourceType($ccr, $uuid){ $e_Source = $ccr->createElement('Source'); $e_Actor = $ccr->createElement('Actor'); $e_Source->appendChild($e_Actor); $e_ActorID = $ccr->createElement('ActorID',$uuid); $e_Actor->appendChild($e_ActorID); return $e_Source;
$e_Test->appendChild($e_DateTime); $e_ExactDateTime = $ccr->createElement('ExactDateTime', $date->format('Y-m-d\\TH:i:s\\Z')); $e_DateTime->appendChild($e_ExactDateTime); $e_Type = $ccr->createElement('Type', 'x ray'); $e_Test->appendChild($e_Type); $e_Text = $ccr->createElement('Text', 'Observation'); $e_Type->appendChild($e_Text); $e_Description = $ccr->createElement('Description'); $e_Test->appendChild($e_Description); $e_Text = $ccr->createElement('Text', $row['ankle_x_ray_interpretation']); $e_Description->appendChild($e_Text); $e_Code = $ccr->createElement('Code'); $e_Description->appendChild($e_Code); $e_Value = $ccr->createElement('Value', 'None'); $e_Code->appendChild($e_Value); $e_Test->appendChild(sourceType($ccr, $authorID)); $e_TestResult = $ccr->createElement('TestResult'); $e_Test->appendChild($e_TestResult); $e_Value = $ccr->createElement('Value', '1.0'); $e_TestResult->appendChild($e_Value); $e_Code = $ccr->createElement('Code'); $e_TestResult->appendChild($e_Code); $e_Value = $ccr->createElement('Value', 'Test 01 Code'); $e_Code->appendChild($e_Value); $e_Description = $ccr->createElement('Description'); $e_TestResult->appendChild($e_Description); $e_Text = $ccr->createElement('Text', $row['ankle_x_ray_interpretation']); $e_Description->appendChild($e_Text); if ('normal' == 'normal') { $e_NormalResult = $ccr->createElement('NormalResult', 'normal'); $e_Test->appendChild($e_NormalResult);
$e_CCRDataObjectID = $ccr->createElement('CCRDataObjectID', getUuid()); $e_Immunization->appendChild($e_CCRDataObjectID); $e_DateTime = $ccr->createElement('DateTime'); $e_Immunization->appendChild($e_DateTime); $date = date_create($row['administered_date']); $e_ExactDateTime = $ccr->createElement('ExactDateTime', $date->format('Y-m-d\\TH:i:s\\Z')); $e_DateTime->appendChild($e_ExactDateTime); $e_Type = $ccr->createElement('Type'); $e_Immunization->appendChild($e_Type); $e_Text = $ccr->createElement('Text', 'Immunization'); $e_Type->appendChild($e_Text); $e_Status = $ccr->createElement('Status'); $e_Immunization->appendChild($e_Status); $e_Text = $ccr->createElement('Text', 'ACTIVE'); $e_Status->appendChild($e_Text); $e_Immunization->appendChild(sourceType($ccr, $sourceID)); $e_Product = $ccr->createElement('Product'); $e_Immunization->appendChild($e_Product); $e_ProductName = $ccr->createElement('ProductName'); $e_Product->appendChild($e_ProductName); $e_Text = $ccr->createElement('Text', $row['title']); $e_ProductName->appendChild($e_Text); $e_Directions = $ccr->createElement('Directions'); $e_Immunization->appendChild($e_Directions); $e_Direction = $ccr->createElement('Direction'); $e_Directions->appendChild($e_Direction); $e_Description = $ccr->createElement('Description'); $e_Direction->appendChild($e_Description); $e_Text = $ccr->createElement('Text', $row['note']); $e_Description->appendChild($e_Text); $e_Code = $ccr->createElement('Code');
$e_Procedure->appendChild($e_Type); $e_Text = $ccr->createElement('Text', $row['type']); $e_Type->appendChild($e_Text); $e_Description = $ccr->createElement('Description'); $e_Procedure->appendChild($e_Description); $e_Text->nodeValue = $row['proc_title']; $e_Description->appendChild(clone $e_Text); $e_Code = $ccr->createElement('Code'); $e_Description->appendChild($e_Code); $e_Value = $ccr->createElement('Value', 'None'); $e_Code->appendChild($e_Value); $e_Status = $ccr->createElement('Status'); $e_Procedure->appendChild($e_Status); $e_Text->nodeValue = $row['outcome']; $e_Status->appendChild(clone $e_Text); $e_Procedure->appendChild(sourceType($ccr, $authorID)); $e_Locations = $ccr->createElement('Locations'); $e_Procedure->appendChild($e_Locations); $e_Location = $ccr->createElement('Location'); $e_Locations->appendChild($e_Location); $e_Description = $ccr->createElement('Description'); $e_Location->appendChild($e_Description); $e_Text->nodeValue = 'body_location'; //$row['laterality']; $e_Description->appendChild(clone $e_Text); $e_Practitioners = $ccr->createElement('Practitioners'); $e_Procedure->appendChild($e_Practitioners); $e_Practitioner = $ccr->createElement('Practitioner'); $e_Practitioners->appendChild($e_Practitioner); $e_ActorRole = $ccr->createElement('ActorRole'); $e_Practitioner->appendChild($e_ActorRole);