Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Select
- hec_act_plannedactions.PlannedFor_Date As TreatmentDate,
- Concat_Ws(' ', cmn_per_personinfo1.Title, cmn_per_personinfo1.FirstName,
- cmn_per_personinfo1.LastName) As OctDoctorName,
- Concat_Ws(', ', hec_cas_cases.Patient_LastName,
- hec_cas_cases.Patient_FirstName) As PatientName,
- hec_act_plannedactions1.IsCancelled,
- hec_act_performedaction_diagnosisupdate_localizations.IM_PotentialDiagnosisLocalization_Code As Localization,
- hec_cas_cases.Patient_BirthDate As PatientBirthDate,
- hec_act_plannedactions.IsPerformed As IsOpPerformed,
- hec_act_plannedactions1.Creation_Timestamp,
- hec_cas_case_universalpropertyvalue.Value_String,
- hec_cas_case_universalpropertyvalue.Value_Boolean
- From
- hec_cas_cases Inner Join
- hec_cas_case_relevantperformedactions
- On hec_cas_cases.HEC_CAS_CaseID =
- hec_cas_case_relevantperformedactions.Case_RefID And
- hec_cas_case_relevantperformedactions.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- hec_cas_case_relevantperformedactions.IsDeleted = 0 Inner Join
- hec_act_plannedactions
- On hec_cas_case_relevantperformedactions.PerformedAction_RefID =
- hec_act_plannedactions.IfPlannedFollowup_PreviousAction_RefID And
- hec_act_plannedactions.Tenant_RefID = x'3cc9b86bf340704696977ddb940a51e1'
- And
- hec_act_plannedactions.IsDeleted = 0 Inner Join
- cmn_bpt_businessparticipants
- On hec_act_plannedactions.ToBePerformedBy_BusinessParticipant_RefID =
- cmn_bpt_businessparticipants.CMN_BPT_BusinessParticipantID And
- cmn_bpt_businessparticipants.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- cmn_bpt_businessparticipants.IsDeleted = 0 Inner Join
- cmn_per_personinfo
- On cmn_bpt_businessparticipants.IfNaturalPerson_CMN_PER_PersonInfo_RefID =
- cmn_per_personinfo.CMN_PER_PersonInfoID And
- cmn_per_personinfo.Tenant_RefID = x'3cc9b86bf340704696977ddb940a51e1' And
- cmn_per_personinfo.IsDeleted = 0 Inner Join
- hec_cas_case_relevantplannedactions
- On hec_cas_cases.HEC_CAS_CaseID =
- hec_cas_case_relevantplannedactions.Case_RefID And
- hec_cas_case_relevantplannedactions.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- hec_cas_case_relevantplannedactions.IsDeleted = 0 Inner Join
- hec_act_plannedactions hec_act_plannedactions1
- On hec_cas_case_relevantplannedactions.PlannedAction_RefID =
- hec_act_plannedactions1.HEC_ACT_PlannedActionID And
- hec_act_plannedactions1.IsPerformed = 0 And
- hec_act_plannedactions1.Tenant_RefID = x'3cc9b86bf340704696977ddb940a51e1'
- And
- hec_act_plannedactions1.IsDeleted = 0 Inner Join
- hec_act_plannedaction_2_actiontype
- On hec_act_plannedactions1.HEC_ACT_PlannedActionID =
- hec_act_plannedaction_2_actiontype.HEC_ACT_PlannedAction_RefID And
- hec_act_plannedaction_2_actiontype.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- hec_act_plannedaction_2_actiontype.IsDeleted = 0 Inner Join
- hec_act_actiontype
- On hec_act_plannedaction_2_actiontype.HEC_ACT_ActionType_RefID =
- hec_act_actiontype.HEC_ACT_ActionTypeID And
- hec_act_actiontype.GlobalPropertyMatchingID =
- 'mm.docconect.doc.app.planned.action.oct' And
- hec_act_actiontype.Tenant_RefID = x'3cc9b86bf340704696977ddb940a51e1' And
- hec_act_actiontype.IsDeleted = 0 Inner Join
- cmn_bpt_businessparticipants cmn_bpt_businessparticipants1
- On hec_act_plannedactions1.ToBePerformedBy_BusinessParticipant_RefID =
- cmn_bpt_businessparticipants1.CMN_BPT_BusinessParticipantID And
- cmn_bpt_businessparticipants1.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- cmn_bpt_businessparticipants1.IsDeleted = 0 Inner Join
- cmn_per_personinfo cmn_per_personinfo1
- On cmn_bpt_businessparticipants1.IfNaturalPerson_CMN_PER_PersonInfo_RefID =
- cmn_per_personinfo1.CMN_PER_PersonInfoID And
- cmn_per_personinfo1.Tenant_RefID = x'3cc9b86bf340704696977ddb940a51e1' And
- cmn_per_personinfo1.IsDeleted = 0 Inner Join
- hec_act_performedaction_diagnosisupdates
- On hec_act_performedaction_diagnosisupdates.HEC_ACT_PerformedAction_RefID =
- hec_cas_case_relevantperformedactions.PerformedAction_RefID And
- hec_act_performedaction_diagnosisupdates.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- hec_act_performedaction_diagnosisupdates.IsDeleted = 0 Inner Join
- hec_act_performedaction_diagnosisupdate_localizations
- On
- hec_act_performedaction_diagnosisupdates.HEC_ACT_PerformedAction_DiagnosisUpdateID = hec_act_performedaction_diagnosisupdate_localizations.HEX_EXC_Action_DiagnosisUpdate_RefID And
- hec_act_performedaction_diagnosisupdate_localizations.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- hec_act_performedaction_diagnosisupdate_localizations.IsDeleted = 0
- Inner Join
- hec_dia_potentialdiagnoses
- On hec_act_performedaction_diagnosisupdates.PotentialDiagnosis_RefID =
- hec_dia_potentialdiagnoses.HEC_DIA_PotentialDiagnosisID And
- hec_dia_potentialdiagnoses.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- hec_dia_potentialdiagnoses.IsDeleted = 0 Inner Join
- hec_dia_potentialdiagnosis_catalogcodes
- On hec_dia_potentialdiagnoses.HEC_DIA_PotentialDiagnosisID =
- hec_dia_potentialdiagnosis_catalogcodes.PotentialDiagnosis_RefID And
- hec_dia_potentialdiagnosis_catalogcodes.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- hec_dia_potentialdiagnosis_catalogcodes.IsDeleted = 0 Inner Join
- hec_doctors
- On hec_act_plannedactions.ToBePerformedBy_BusinessParticipant_RefID =
- hec_doctors.BusinessParticipant_RefID And
- hec_doctors.Tenant_RefID = x'3cc9b86bf340704696977ddb940a51e1' And
- hec_doctors.IsDeleted = 0 Inner Join
- hec_doctors hec_doctors1
- On hec_act_plannedactions1.ToBePerformedBy_BusinessParticipant_RefID =
- hec_doctors1.BusinessParticipant_RefID And
- hec_doctors1.Tenant_RefID = x'3cc9b86bf340704696977ddb940a51e1' And
- hec_doctors1.IsDeleted = 0 Inner Join
- cmn_bpt_ctm_organizationalunit_staff
- On hec_act_plannedactions.ToBePerformedBy_BusinessParticipant_RefID =
- cmn_bpt_ctm_organizationalunit_staff.BusinessParticipant_RefID And
- cmn_bpt_ctm_organizationalunit_staff.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- cmn_bpt_ctm_organizationalunit_staff.IsDeleted = 0 Inner Join
- cmn_bpt_ctm_organizationalunits
- On cmn_bpt_ctm_organizationalunit_staff.OrganizationalUnit_RefID =
- cmn_bpt_ctm_organizationalunits.CMN_BPT_CTM_OrganizationalUnitID And
- cmn_bpt_ctm_organizationalunits.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- cmn_bpt_ctm_organizationalunits.IsDeleted = 0 Inner Join
- cmn_bpt_ctm_organizationalunit_staff cmn_bpt_ctm_organizationalunit_staff1
- On hec_act_plannedactions1.ToBePerformedBy_BusinessParticipant_RefID =
- cmn_bpt_ctm_organizationalunit_staff1.BusinessParticipant_RefID And
- cmn_bpt_ctm_organizationalunit_staff1.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- cmn_bpt_ctm_organizationalunit_staff1.IsDeleted = 0 Inner Join
- cmn_bpt_ctm_organizationalunits cmn_bpt_ctm_organizationalunits1
- On cmn_bpt_ctm_organizationalunit_staff1.OrganizationalUnit_RefID =
- cmn_bpt_ctm_organizationalunits1.CMN_BPT_CTM_OrganizationalUnitID And
- cmn_bpt_ctm_organizationalunits1.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- cmn_bpt_ctm_organizationalunits1.IsDeleted = 0 Inner Join
- cmn_bpt_ctm_customers
- On cmn_bpt_ctm_organizationalunits.Customer_RefID =
- cmn_bpt_ctm_customers.CMN_BPT_CTM_CustomerID And
- cmn_bpt_ctm_customers.Tenant_RefID = x'3cc9b86bf340704696977ddb940a51e1' And
- cmn_bpt_ctm_customers.IsDeleted = 0 Inner Join
- cmn_bpt_businessparticipants cmn_bpt_businessparticipants2
- On cmn_bpt_ctm_customers.Ext_BusinessParticipant_RefID =
- cmn_bpt_businessparticipants2.CMN_BPT_BusinessParticipantID And
- cmn_bpt_businessparticipants2.Tenant_RefID =
- x'3cc9b86bf340704696977ddb940a51e1' And
- cmn_bpt_businessparticipants2.IsDeleted = 0 Inner Join
- hec_cas_case_universalpropertyvalue
- On hec_cas_case_relevantperformedactions.Case_RefID =
- hec_cas_case_universalpropertyvalue.HEC_CAS_Case_RefID Inner Join
- hec_cas_case_universalproperties
- On hec_cas_case_universalproperties.HEC_CAS_Case_UniversalPropertyID =
- hec_cas_case_universalpropertyvalue.HEC_CAS_Case_UniversalProperty_RefID
- Where
- hec_cas_cases.Patient_RefID = x'c0d00607c5d8eb4b8eceaf3f294d6157' And
- hec_cas_cases.Tenant_RefID = x'3cc9b86bf340704696977ddb940a51e1' And
- hec_cas_cases.IsDeleted = 0 And
- hec_cas_case_universalproperties.GlobalPropertyMatchingID Like '%until%'
- Order By
- TreatmentDate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement