/**
  * @param $PortionData
  * @param $CompleteData
  * @return array|Exception
  */
 public static function Insert($PortionData, $CompleteData)
 {
     try {
         // Validate first
         self::Validate($PortionData);
         $Entry = ['observation' => ['@attributes' => ['classCode' => 'OBS', 'moodCode' => 'EVN'], 'templateId' => Component::templateId('2.16.840.1.113883.10.20.24.3.90.2'), 'id' => Component::id(Utilities::UUIDv4()), 'code' => ['@attributes' => ['code' => 'ASSERTION', 'codeSystem' => '2.16.840.1.113883.5.4']], 'statusCode' => Component::statusCode('completed'), 'effectiveTime' => Component::time($PortionData['onsetDate'], $PortionData['resolutionDate'])]];
         // SHOULD contain zero or more [0..*] Author Participation (NEW)
         if (count($PortionData['Author']) > 0) {
             foreach ($PortionData['Author'] as $Author) {
                 $Entry['observation']['author'][] = LevelOther\authorParticipation::Insert($Author, $CompleteData);
             }
         }
         // SHALL contain at least one [1..*] entryRelationship
         // SHALL contain exactly one [1..1] Reaction Observation (V2)
         if (count($PortionData['ReactionObservation']) > 0) {
             foreach ($PortionData['ReactionObservation'] as $ReactionObservation) {
                 $Entry['observation']['entryRelationship'][] = reactionObservation::Insert($ReactionObservation, $CompleteData);
             }
         }
         // SHALL contain at least one [1..*] entryRelationship
         // SHALL contain exactly one [1..1] Severity Observation (V2)
         if (count($PortionData['SeverityObservation']) > 0) {
             foreach ($PortionData['SeverityObservation'] as $SeverityObservation) {
                 $Entry['observation']['entryRelationship'][] = severityObservation::Insert($SeverityObservation, $CompleteData);
             }
         }
         return $Entry;
     } catch (Exception $Error) {
         return $Error;
     }
 }
Ejemplo n.º 2
0
 /**
  * @param $PortionData
  * @param $CompleteData
  * @return array|Exception
  */
 public static function Insert($PortionData, $CompleteData)
 {
     try {
         // Validate first
         self::Validate($PortionData);
         $Entry = ['substanceAdministration' => ['@attributes' => ['classCode' => 'SBADM', 'moodCode' => 'EVN'], 'templateId' => Component::templateId('2.16.840.1.113883.10.20.22.4.52.2'), 'id' => Component::id(Utilities::UUIDv4()), 'statusCode' => Component::statusCode('completed'), 'effectiveTime' => Component::time($PortionData['effectiveTime']), 'routeCode' => ['@attributes' => ['code' => $PortionData['routeCode'], 'codeSystem' => Utilities::CodingSystemId($PortionData['routeCodeSystemName']), 'codeSystemName' => $PortionData['routeCodeSystemName'], 'displayName' => $PortionData['routeDisplayName']]], 'doseQuantity' => ['@attributes' => ['value' => $PortionData['doseQuantityValue'], 'unit' => $PortionData['doseQuantityUnit']]], 'consumable' => ['manufacturedProduct' => immunizationMedicationInformation::Insert($PortionData, $CompleteData)], 'performer' => LevelDocument\performer::Insert($PortionData)]];
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Indication (V2)
         if (count($PortionData['Indication']) > 0) {
             foreach ($PortionData['Indication'] as $Indication) {
                 $Entry['substanceAdministration']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'RSON'], indication::Insert($Indication, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..1] entryRelationship
         // SHALL contain exactly one [1..1] Instruction (V2)
         if (count($PortionData['Instruction']) > 0) {
             $Entry['substanceAdministration']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'SUBJ'], instruction::Insert($PortionData['Instruction'][0], $CompleteData)];
         }
         // MAY contain zero or more [0..1] entryRelationship
         // SHALL contain exactly one [1..1] Medication Supply Order (V2)
         if (count($PortionData['MedicationSupplyOrder']) > 0) {
             $Entry['substanceAdministration']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], medicationSupplyOrder::Insert($PortionData['MedicationSupplyOrder'][0], $CompleteData)];
         }
         // MAY contain zero or more [0..1] entryRelationship
         // SHALL contain exactly one [1..1] Medication Dispense (V2)
         if (count($PortionData['MedicationDispense']) > 0) {
             $Entry['substanceAdministration']['supply'][] = ['@attributes' => ['typeCode' => 'REFR'], medicationDispense::Insert($PortionData['MedicationDispense'][0], $CompleteData)];
         }
         // MAY contain zero or more [0..1] entryRelationship
         // SHALL contain exactly one [1..1] Reaction Observation (V2)
         if (count($PortionData['ReactionObservation']) > 0) {
             $Entry['substanceAdministration']['supply'][] = ['@attributes' => ['typeCode' => 'CAUS'], reactionObservation::Insert($PortionData['ReactionObservation'][0], $CompleteData)];
         }
         // MAY contain zero or more [0..1] entryRelationship
         // SHALL contain exactly one [1..1] Immunization Refusal Reason
         if (count($PortionData['ImmunizationRefusalReason']) > 0) {
             $Entry['substanceAdministration']['supply'][] = ['@attributes' => ['typeCode' => 'RSON'], immunizationRefusalReason::Insert($PortionData['ImmunizationRefusalReason'][0], $CompleteData)];
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Substance Administered Act (NEW)
         if (count($PortionData['SubstanceAdministeredAct']) > 0) {
             foreach ($PortionData['SubstanceAdministeredAct'] as $SubstanceAdministeredAct) {
                 $Entry['substanceAdministration']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'COMP', 'inversionInd' => 'true'], substanceAdministeredAct::Insert($SubstanceAdministeredAct, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Substance Administered Act (NEW)
         if (count($PortionData['PreconditionForSubstanceAdministration']) > 0) {
             foreach ($PortionData['PreconditionForSubstanceAdministration'] as $PreconditionForSubstanceAdministration) {
                 $Entry['substanceAdministration']['precondition'][] = ['@attributes' => ['typeCode' => 'PRCN'], preconditionForSubstanceAdministration::Insert($PreconditionForSubstanceAdministration, $CompleteData)];
             }
         }
         return $Entry;
     } catch (Exception $Error) {
         return $Error;
     }
 }
Ejemplo n.º 3
0
 /**
  * @return array
  */
 public static function Structure()
 {
     return ['TextObservation' => ['onsetDate' => 'SHALL contain exactly one [1..1] effectiveTime', 'resolutionDate' => 'SHALL contain exactly one [1..1] effectiveTime', LevelOther\authorParticipation::Structure(), reactionObservation::Structure(), severityObservation::Structure(), sopInstanceObservation::Structure(), quantityMeasurementObservation::Structure()]];
 }
Ejemplo n.º 4
0
 /**
  * @param $PortionData
  * @param $CompleteData
  * @return array|Exception
  */
 public static function Insert($PortionData, $CompleteData)
 {
     try {
         // Validate first
         self::Validate($PortionData);
         $Entry = ['act' => ['@attributes' => ['classCode' => 'ACT', 'moodCode' => 'EVN'], 'templateId' => Component::templateId('2.16.840.1.113883.10.20.22.4.132'), 'id' => Component::id(Utilities::UUIDv4()), 'code' => ['@attributes' => ['code' => 'CONC', 'displayName' => 'handoff communication (procedure)', 'codeSystem' => '2.16.840.1.113883.5.6', 'codeSystemName' => 'HL7ActClass', 'displayName' => 'Concern']], 'statusCode' => Component::statusCode('active'), 'effectiveTime' => Component::time($PortionData['effectiveTime'])]];
         // SHOULD contain zero or more [0..*] Author Participation (NEW)
         if (count($PortionData['Author']) > 0) {
             foreach ($PortionData['Author'] as $Author) {
                 $Entry['act']['author'][] = LevelOther\authorParticipation::Insert($Author, $CompleteData);
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Problem Observation (V2)
         if (count($PortionData['ProblemObservation']) > 0) {
             foreach ($PortionData['ProblemObservation'] as $ProblemObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], problemObservation::Insert($ProblemObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Allergy - Intolerance Observation (V2)
         if (count($PortionData['AllergyIntoleranceObservation']) > 0) {
             foreach ($PortionData['AllergyIntoleranceObservation'] as $AllergyIntoleranceObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], allergyIntoleranceObservation::Insert($AllergyIntoleranceObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Assessment Scale Observation
         if (count($PortionData['AssessmentScaleObservation']) > 0) {
             foreach ($PortionData['AssessmentScaleObservation'] as $AssessmentScaleObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], assessmentScaleObservation::Insert($AssessmentScaleObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Self-Care Activities (ADL and IADL) (NEW)
         if (count($PortionData['SelfCareActivitiesADLAndIADL']) > 0) {
             foreach ($PortionData['SelfCareActivitiesADLAndIADL'] as $SelfCareActivitiesADLAndIADL) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], selfCareActivitiesADLAndIADL::Insert($SelfCareActivitiesADLAndIADL, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Cognitive Abilities Observation (NEW)
         if (count($PortionData['CognitiveAbilitiesObservation']) > 0) {
             foreach ($PortionData['CognitiveAbilitiesObservation'] as $CognitiveAbilitiesObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], cognitiveAbilitiesObservation::Insert($CognitiveAbilitiesObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Cognitive Status Observation (V2)
         if (count($PortionData['CognitiveStatusObservation']) > 0) {
             foreach ($PortionData['CognitiveStatusObservation'] as $CognitiveStatusObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], cognitiveStatusObservation::Insert($CognitiveStatusObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Cognitive Status Observation (V2)
         if (count($PortionData['CurrentSmokingStatus']) > 0) {
             foreach ($PortionData['CurrentSmokingStatus'] as $CurrentSmokingStatus) {
                 $Entry['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], 'observation' => currentSmokingStatus::Insert($CurrentSmokingStatus, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Encounter Diagnosis (V2)
         if (count($PortionData['EncounterDiagnosis']) > 0) {
             foreach ($PortionData['EncounterDiagnosis'] as $EncounterDiagnosis) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], encounterDiagnosis::Insert($EncounterDiagnosis, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Family History Organizer
         if (count($PortionData['FamilyHistoryOrganizer']) > 0) {
             foreach ($PortionData['FamilyHistoryOrganizer'] as $FamilyHistoryOrganizer) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], familyHistoryOrganizer::Insert($FamilyHistoryOrganizer, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Functional Status Observation (V2)
         if (count($PortionData['FunctionalStatusObservation']) > 0) {
             foreach ($PortionData['FunctionalStatusObservation'] as $FunctionalStatusObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], functionalStatusObservation::Insert($FunctionalStatusObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Hospital Admission Diagnosis (V2)
         if (count($PortionData['HospitalAdmissionDiagnosis']) > 0) {
             foreach ($PortionData['HospitalAdmissionDiagnosis'] as $HospitalAdmissionDiagnosis) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], hospitalAdmissionDiagnosis::Insert($HospitalAdmissionDiagnosis, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Mental Status Observation (NEW)
         if (count($PortionData['MentalStatusObservation']) > 0) {
             foreach ($PortionData['MentalStatusObservation'] as $MentalStatusObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], mentalStatusObservation::Insert($MentalStatusObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Nutrition Assessment (NEW)
         if (count($PortionData['NutritionAssessment']) > 0) {
             foreach ($PortionData['NutritionAssessment'] as $NutritionAssessment) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], nutritionAssessment::Insert($NutritionAssessment, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Nutrition Assessment (NEW)
         if (count($PortionData['PostprocedureDiagnosis']) > 0) {
             foreach ($PortionData['PostprocedureDiagnosis'] as $PostprocedureDiagnosis) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], postprocedureDiagnosis::Insert($PostprocedureDiagnosis, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Pregnancy Observation
         if (count($PortionData['PregnancyObservation']) > 0) {
             foreach ($PortionData['PregnancyObservation'] as $PregnancyObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], pregnancyObservation::Insert($PregnancyObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Preoperative Diagnosis (V2)
         if (count($PortionData['PreoperativeDiagnosis']) > 0) {
             foreach ($PortionData['PreoperativeDiagnosis'] as $PreoperativeDiagnosis) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], preoperativeDiagnosis::Insert($PreoperativeDiagnosis, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Reaction Observation (V2)
         if (count($PortionData['ReactionObservation']) > 0) {
             foreach ($PortionData['ReactionObservation'] as $ReactionObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], reactionObservation::Insert($ReactionObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Reaction Observation (V2)
         if (count($PortionData['ResultObservation']) > 0) {
             foreach ($PortionData['ResultObservation'] as $ResultObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], resultObservation::Insert($ResultObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Sensory and Speech Status (NEW)
         if (count($PortionData['SensoryAndSpeechStatus']) > 0) {
             foreach ($PortionData['SensoryAndSpeechStatus'] as $SensoryAndSpeechStatus) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], sensoryAndSpeechStatus::Insert($SensoryAndSpeechStatus, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Social History Observation (V2)
         if (count($PortionData['SocialHistoryObservation']) > 0) {
             foreach ($PortionData['SocialHistoryObservation'] as $SocialHistoryObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], socialHistoryObservation::Insert($SocialHistoryObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Substance or Device Allergy - Intolerance Observation (V2)
         if (count($PortionData['SubstanceOrDeviceAllergyIntoleranceObservation']) > 0) {
             foreach ($PortionData['SubstanceOrDeviceAllergyIntoleranceObservation'] as $SubstanceOrDeviceAllergyIntoleranceObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], substanceOrDeviceAllergyIntoleranceObservation::Insert($SubstanceOrDeviceAllergyIntoleranceObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Tobacco Use (V2)
         if (count($PortionData['TobaccoUse']) > 0) {
             foreach ($PortionData['TobaccoUse'] as $TobaccoUse) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], tobaccoUse::Insert($TobaccoUse, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Vital Sign Observation (V2)
         if (count($PortionData['VitalSignObservation']) > 0) {
             foreach ($PortionData['VitalSignObservation'] as $VitalSignObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], vitalSignObservation::Insert($VitalSignObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Wound Observation (NEW)
         if (count($PortionData['WoundObservation']) > 0) {
             foreach ($PortionData['WoundObservation'] as $WoundObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], woundObservation::Insert($WoundObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Caregiver Characteristics
         if (count($PortionData['CaregiverCharacteristics']) > 0) {
             foreach ($PortionData['CaregiverCharacteristics'] as $CaregiverCharacteristics) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], caregiverCharacteristics::Insert($CaregiverCharacteristics, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Cultural and Religious Observation (NEW)
         if (count($PortionData['CulturalAndReligiousObservation']) > 0) {
             foreach ($PortionData['CulturalAndReligiousObservation'] as $CulturalAndReligiousObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], culturalAndReligiousObservation::Insert($CulturalAndReligiousObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Characteristics of Home Environment (NEW)
         if (count($PortionData['CharacteristicsOfHomeEnvironment']) > 0) {
             foreach ($PortionData['CharacteristicsOfHomeEnvironment'] as $CharacteristicsOfHomeEnvironment) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], characteristicsOfHomeEnvironment::Insert($CharacteristicsOfHomeEnvironment, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Nutritional Status Observation (NEW)
         if (count($PortionData['NutritionalStatusObservation']) > 0) {
             foreach ($PortionData['NutritionalStatusObservation'] as $NutritionalStatusObservation) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], nutritionalStatusObservation::Insert($NutritionalStatusObservation, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Result Organizer (V2)
         if (count($PortionData['ResultOrganizer']) > 0) {
             foreach ($PortionData['ResultOrganizer'] as $ResultOrganizer) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], resultOrganizer::Insert($ResultOrganizer, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Patient Priority Preference (NEW)
         if (count($PortionData['PatientPriorityPreference']) > 0) {
             foreach ($PortionData['PatientPriorityPreference'] as $PatientPriorityPreference) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], patientPriorityPreference::Insert($PatientPriorityPreference, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Provider Priority Preference (NEW)
         if (count($PortionData['ProviderPriorityPreference']) > 0) {
             foreach ($PortionData['ProviderPriorityPreference'] as $ProviderPriorityPreference) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], providerPriorityPreference::Insert($ProviderPriorityPreference, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Problem Concern Act (Condition) (V2)
         if (count($PortionData['ProblemConcernActCondition']) > 0) {
             foreach ($PortionData['ProblemConcernActCondition'] as $ProblemConcernActCondition) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], problemConcernActCondition::Insert($ProblemConcernActCondition, $CompleteData)];
             }
         }
         // MAY contain zero or more [0..*] entryRelationship
         // SHALL contain exactly one [1..1] Act Reference (NEW)
         if (count($PortionData['ActReference']) > 0) {
             foreach ($PortionData['ActReference'] as $ActReference) {
                 $Entry['act']['entryRelationship'][] = ['@attributes' => ['typeCode' => 'REFR'], actReference::Insert($ActReference, $CompleteData)];
             }
         }
         return $Entry;
     } catch (Exception $Error) {
         return $Error;
     }
 }