/// <summary> /// Convert databased model to model /// </summary> public Core.Model.Acts.SubstanceAdministration ToModelInstance(DbSubstanceAdministration sbadmInstance, DbActVersion actVersionInstance, DbAct actInstance, DataContext context, IPrincipal principal) { var retVal = m_actPersister.ToModelInstance <Core.Model.Acts.SubstanceAdministration>(actVersionInstance, actInstance, context, principal); if (retVal == null) { return(null); } else if (sbadmInstance == null) { this.m_tracer.TraceEvent(System.Diagnostics.TraceEventType.Warning, -0493043, "SBADM is missing SBADM data: {0}", actInstance.Key); return(null); } if (sbadmInstance.DoseUnitConceptKey != null) { retVal.DoseUnitKey = sbadmInstance.DoseUnitConceptKey; } if (sbadmInstance.RouteConceptKey != null) { retVal.RouteKey = sbadmInstance.RouteConceptKey; } if (sbadmInstance.SiteConceptKey != null) { retVal.SiteKey = sbadmInstance.SiteConceptKey; } retVal.DoseQuantity = sbadmInstance.DoseQuantity; retVal.SequenceId = (int)sbadmInstance.SequenceId; return(retVal); }
/// <summary> /// Convert databased model to model /// </summary> public Core.Model.Acts.Procedure ToModelInstance(DbProcedure procedureInstance, DbActVersion actVersionInstance, DbAct actInstance, DataContext context, IPrincipal principal) { var retVal = m_actPersister.ToModelInstance <Core.Model.Acts.Procedure>(actVersionInstance, actInstance, context, principal); if (retVal == null) { return(null); } else if (procedureInstance == null) { this.m_tracer.TraceEvent(System.Diagnostics.TraceEventType.Warning, -0493043, "PROC is missing PROC data: {0}", actInstance.Key); return(null); } if (procedureInstance.MethodConceptKey != null) { retVal.MethodKey = procedureInstance.MethodConceptKey; } if (procedureInstance.ApproachSiteConceptKey != null) { retVal.ApproachSiteKey = procedureInstance.ApproachSiteConceptKey; } if (procedureInstance.TargetSiteConceptKey != null) { retVal.TargetSiteKey = procedureInstance.TargetSiteConceptKey; } return(retVal); }
/// <summary> /// Convert a data act and observation instance to an observation /// </summary> public virtual TObservation ToModelInstance <TObservation>(DbObservation dataInstance, DbActVersion actVersionInstance, DbAct actInstance, DataContext context) where TObservation : Observation, new() { var retVal = m_actPersister.ToModelInstance <TObservation>(actVersionInstance, actInstance, context); if (retVal == null) { return(null); } if (dataInstance.InterpretationConceptKey != null) { retVal.InterpretationConceptKey = dataInstance.InterpretationConceptKey; } return(retVal); }
/// <summary> /// Convert database instance to patient encounter /// </summary> public Core.Model.Acts.PatientEncounter ToModelInstance(DbPatientEncounter dbEnc, DbActVersion actVersionInstance, DbAct actInstance, DataContext context, IPrincipal principal) { var retVal = m_actPersister.ToModelInstance <Core.Model.Acts.PatientEncounter>(actVersionInstance, actInstance, context, principal); if (retVal == null) { return(null); } else if (dbEnc == null) { this.m_tracer.TraceEvent(System.Diagnostics.TraceEventType.Warning, -0493043, "ENC is missing ENC data: {0}", actInstance.Key); return(null); } if (dbEnc.DischargeDispositionKey != null) { retVal.DischargeDispositionKey = dbEnc.DischargeDispositionKey; } return(retVal); }
/// <summary> /// Convert a data act and observation instance to an observation /// </summary> public virtual Observation ToModelInstance(DbObservation dataInstance, DbActVersion actVersionInstance, DbAct actInstance, DataContext context) { return(this.ToModelInstance <Observation>(dataInstance, actVersionInstance, actInstance, context)); }