$socialHistory = array('SocialHistoryElement' => array(array('CCRDocumentObjectID' => UUID::v4(), 'Type' => array('Text' => 'Smoking', 'Code' => array('Value' => '230056004', 'CodingSystem' => 'SNOMED CT')), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'Episodes' => array('Episode' => array(array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('DateTimeRange' => array('BeginRange' => array('ExactDateTime' => '1947'), 'EndRange' => array('ExactDateTime' => '1972'))), 'Description' => array('Text' => '1 pack per day'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('DateTimeRange' => array('BeginRange' => array('ExactDateTime' => '1973'))), 'Description' => array('Text' => 'None'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID))), 'Source' => array('Actor' => array('ActorID' => $softwareGUID))))), array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('DateTimeRange' => array('BeginRange' => array('ExactDateTime' => '1973'))), 'Type' => array('Text' => 'ETOH Use', 'Code' => array('Value' => '160573003', 'CodingSystem' => 'SNOMED CT')), 'Description' => array('Text' => 'None'), 'Source' => array('Actor' => array('ActorID' => $softwareGUID))))); /** * Family History section - (OPTIONAL) * ---------------------- * This section contains data defining the patient’s genetic relatives in terms of possible or relevant health risk * factors that have a potential impact on the patient’s healthcare risk profile. */ $familyHistoryProblems = array('FamilyProblemHistory' => array(array('CCRDocumentObjectID' => UUID::v4(), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)), 'FamilyMember' => array('ActorID' => $familyMemberLink1, 'ActorRole' => array('Text' => 'Father'), 'HealthStatus' => array('Description' => array('Text' => 'Deceased'), 'CauseOfDeath' => 'Yes', 'Source' => array('Actor' => array('ActorID' => $softwareGUID))), 'Source' => array('Actor' => array('ActorID' => $softwareGUID))), 'Problem' => array('Description' => array('Text' => 'Myocardial Infarction', 'Code' => array('Value' => '22298006', 'CodingSystem' => 'SNOMED CT')), 'Episodes' => array('Number' => '1', 'Episode' => array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('Type' => array('Text' => 'Age At Onset'), 'Age' => array('Value' => '57', 'Units' => array('Unit' => 'Years'))), 'Source' => array('Actor' => array('ActorID' => $softwareGUID))), 'Source' => array('Actor' => array('ActorID' => $softwareGUID))), 'Source' => array('Actor' => array('ActorID' => $softwareGUID)))))); /** * Problems section - (SHALL) * ---------------- * This section lists and describes all relevant clinical problems at the time the summary is generated. At a * minimum, all pertinent current and historical problems should be listed. CDA R2 represents problems as * Observations. */ $patientProblems = $Medical->getPatientProblemsByPid($pid); $problems = array(); foreach ($patientProblems as $item) { $problems[] = array('Problem' => array(array('CCRDocumentObjectID' => UUID::v4(), 'DateTime' => array('ExactDateTime' => date("Y-m-d", strtotime($item['begin_date']))), 'Description' => array('Text' => $item['code_text'], 'Code' => array('Value' => $item['code'], 'CodingSystem' => $item['code_type'])), 'Status' => array('Text' => $item['end_date'] == '' ? 'Active' : 'Not active', 'Code' => array('Value' => '55561003', 'CodingSystem' => 'SNOMED CT')), 'Source' => array('Actor' => array('ActorID' => $softwareGUID))))); } /** * Functional Status section - (OPTIONAL) * ------------------------- * Functional Status describes the patient’s status of normal functioning at the time the Care Record was * created. Functional statuses include information regarding the patient relative to: * • Ambulatory ability * • Mental status or competency * • Activities of Daily Living (ADLs), including bathing, dressing, feeding, grooming * • Home / living situation having an effect on the health status of the patient * • Ability to care for self * • Social activity, including issues with social cognition, participation with friends and acquaintances other than family members