// TODO: Based on some business rule private OutsidePrescriptionType TransformRemMedicationIntoOutsidePrescriptionAsMappedDrug( Medication medication ) { Check.IsNotNull ( medication.UsageDateRange.StartDate, "Medication Usage Start Date cannot be null" ); Debug.Assert ( medication.UsageDateRange.StartDate != null, "medication.UsageDateRange.StartDate != null" ); var prescription = new OutsidePrescriptionType { ExternalId = medication.Key.ToString (), Date = medication.UsageDateRange.StartDate.Value.ToString ( "yyyMMdd" ), DoctorName = medication.PrescribingPhysicianName, DrugIdentifierTypeSpecified = true, DrugIdentifier = medication.MedicationCodeCodedConcept.CodedConceptCode, DrugIdentifierType = DrugDatabaseType.RXNORM, PrescriptionType = "reconcile", }; return prescription; }
private static OutsidePrescriptionType TransformRemMedicationIntoOutsidePrescriptionAsFreeText( Medication medication ) { Check.IsNotNull ( medication.UsageDateRange, "Medication Usage Range was provided for " + medication.MedicationCodeCodedConcept.DisplayName ); Check.IsNotNull ( medication.UsageDateRange.StartDate, "Medication Usage Start Date cannot be null" ); Debug.Assert ( medication.UsageDateRange.StartDate != null, "medication.UsageDateRange.StartDate != null" ); var prescription = new OutsidePrescriptionType { ExternalId = medication.Key.ToString (), Date = medication.UsageDateRange.StartDate.Value.ToString ( "yyyMMdd" ), DoctorName = medication.PrescribingPhysicianName, DrugIdentifierTypeSpecified = false, Drug = NcScriptHelper.RemoveUnwantedPartsFromDrugName ( medication.RootMedicationCodedConcept.DisplayName ), //// DrugIdentifier = medication.MedicationCodeCodedConcept.CodedConceptCode, PrescriptionType = "reconcile", ////DispenseNumber = "0", ////RefillCount = "0", Sig = medication.FrequencyDescription, PrescriptionStatus = NcScriptHelper.TransformRemMedicationStatusIntoNewCropPrescriptionStatus ( medication.MedicationStatus.WellKnownName ), PrescriptionArchiveStatus = NcScriptHelper.TransformRemMedicationIntoNewCropPrescriptionArchiveStatus ( medication.MedicationStatus.WellKnownName ), }; return prescription; }