public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as MedicationPrescription; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (DateWrittenElement != null) { dest.DateWrittenElement = (Hl7.Fhir.Model.FhirDateTime)DateWrittenElement.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.MedicationPrescription.MedicationPrescriptionStatus>)StatusElement.DeepCopy(); } if (Patient != null) { dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); } if (Prescriber != null) { dest.Prescriber = (Hl7.Fhir.Model.ResourceReference)Prescriber.DeepCopy(); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (Reason != null) { dest.Reason = (Hl7.Fhir.Model.Element)Reason.DeepCopy(); } if (Medication != null) { dest.Medication = (Hl7.Fhir.Model.ResourceReference)Medication.DeepCopy(); } if (DosageInstruction != null) { dest.DosageInstruction = new List <Hl7.Fhir.Model.MedicationPrescription.MedicationPrescriptionDosageInstructionComponent>(DosageInstruction.DeepCopy()); } if (Dispense != null) { dest.Dispense = (Hl7.Fhir.Model.MedicationPrescription.MedicationPrescriptionDispenseComponent)Dispense.DeepCopy(); } if (Substitution != null) { dest.Substitution = (Hl7.Fhir.Model.MedicationPrescription.MedicationPrescriptionSubstitutionComponent)Substitution.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (Identifier != null) { Identifier.ForEach(elem => result.AddRange(elem.Validate())); } if (DateWrittenElement != null) { result.AddRange(DateWrittenElement.Validate()); } if (StatusElement != null) { result.AddRange(StatusElement.Validate()); } if (Patient != null) { result.AddRange(Patient.Validate()); } if (Prescriber != null) { result.AddRange(Prescriber.Validate()); } if (Encounter != null) { result.AddRange(Encounter.Validate()); } if (ReasonForPrescribing != null) { result.AddRange(ReasonForPrescribing.Validate()); } if (Medication != null) { result.AddRange(Medication.Validate()); } if (DosageInstruction != null) { DosageInstruction.ForEach(elem => result.AddRange(elem.Validate())); } if (Dispense != null) { result.AddRange(Dispense.Validate()); } if (Substitution != null) { result.AddRange(Substitution.Validate()); } return(result); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as VisionPrescription; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.FinancialResourceStatusCodes>)StatusElement.DeepCopy(); } if (Patient != null) { dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (DateWrittenElement != null) { dest.DateWrittenElement = (Hl7.Fhir.Model.FhirDateTime)DateWrittenElement.DeepCopy(); } if (Prescriber != null) { dest.Prescriber = (Hl7.Fhir.Model.ResourceReference)Prescriber.DeepCopy(); } if (Reason != null) { dest.Reason = (Hl7.Fhir.Model.DataType)Reason.DeepCopy(); } if (Dispense != null) { dest.Dispense = new List <Hl7.Fhir.Model.VisionPrescription.DispenseComponent>(Dispense.DeepCopy()); } return(dest); }
public override void Run() { Drug drug = new Drug(DrugId); Prescriber prescriber = new Prescriber(PrescriberId); User user = new User(prescriber.Profile.UserID); StringBuilder message = new StringBuilder(); message.Append("Your certification for "); message.Append(drug.GenericName); message.Append(" needs to be renewed."); Notification n = Lib.Systems.Notifications.NotificationService.Create( "Certification renewal notice", message.ToString(), true, Lib.Systems.Notifications.NotificationService.DataType.Drug, DrugId); Lib.Systems.Notifications.NotificationService.Send(n, user); }
public JsonResult SendData(Clinic clinic, Prescriber prescriber, SecondaryContact secondaryContact) { return(Json("Ok", JsonRequestBehavior.AllowGet)); }
/// <summary> /// Serialize to a JSON object /// </summary> public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true) { if (includeStartObject) { writer.WriteStartObject(); } if (!string.IsNullOrEmpty(ResourceType)) { writer.WriteString("resourceType", (string)ResourceType !); } ((Fhir.R4.Models.DomainResource) this).SerializeJson(writer, options, false); if ((Identifier != null) && (Identifier.Count != 0)) { writer.WritePropertyName("identifier"); writer.WriteStartArray(); foreach (Identifier valIdentifier in Identifier) { valIdentifier.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (!string.IsNullOrEmpty(Status)) { writer.WriteString("status", (string)Status !); } if (_Status != null) { writer.WritePropertyName("_status"); _Status.SerializeJson(writer, options); } if (!string.IsNullOrEmpty(Created)) { writer.WriteString("created", (string)Created !); } if (_Created != null) { writer.WritePropertyName("_created"); _Created.SerializeJson(writer, options); } if (Patient != null) { writer.WritePropertyName("patient"); Patient.SerializeJson(writer, options); } if (Encounter != null) { writer.WritePropertyName("encounter"); Encounter.SerializeJson(writer, options); } if (!string.IsNullOrEmpty(DateWritten)) { writer.WriteString("dateWritten", (string)DateWritten !); } if (_DateWritten != null) { writer.WritePropertyName("_dateWritten"); _DateWritten.SerializeJson(writer, options); } if (Prescriber != null) { writer.WritePropertyName("prescriber"); Prescriber.SerializeJson(writer, options); } if ((LensSpecification != null) && (LensSpecification.Count != 0)) { writer.WritePropertyName("lensSpecification"); writer.WriteStartArray(); foreach (VisionPrescriptionLensSpecification valLensSpecification in LensSpecification) { valLensSpecification.SerializeJson(writer, options, true); } writer.WriteEndArray(); } if (includeStartObject) { writer.WriteEndObject(); } }