|
|
@@ -354,4 +354,188 @@
|
|
|
left join (select * from im_group_user where user_id= #{currentUserId}) as igu on igu.group_id=bcr.id
|
|
|
where bcr.id=#{clinicId}
|
|
|
</select>
|
|
|
+ <sql id="ClinicAndInfusionColumn">
|
|
|
+ bih.id AS infusion_id,bih.device_id,bih.classification,bih.data_num,bih.total_dose,
|
|
|
+ bih.first_dose,bih.remain_dose,bih.input_dose,bih.append_dose,bih.append_lock_time,bih.max_dose,
|
|
|
+ bih.self_control_count,bih.self_control_lock_time,bih.pca_valid_count,bih.pca_invalid_count,
|
|
|
+ bih.pca_total_count,bih.continue_dose,bih.pulse_dose,bih.pulse_lock_time,bih.pulse_first_lock_time,
|
|
|
+ bih.flow_up_cycle,bih.flow_down_cycle,bih.flow_count,bih.flow_up_limit,bih.flow_down_limit,
|
|
|
+ bih.flow_adjust_rate,bih.flow_restricted,bih.warn_flow,bih.electric_quantity,bih.device_run_state,
|
|
|
+ bih.device_alarm,bih.infusion_start_time,bih.last_upload_time,bih.device_type,bih.hospital_code,
|
|
|
+ bih.warn_will_finished,bih.warn_analgesic_poor,bih.warn_low_battery
|
|
|
+ </sql>
|
|
|
+ <resultMap id="ClinicAndDevice" type="cn.tr.module.smart.common.vo.BizClinicAndDeviceVO">
|
|
|
+ <result property="clinicId" column="clinic_id"/>
|
|
|
+ <result property="clinicName" column="clinic_name"/>
|
|
|
+ <result property="clinicNameDoctor" column="clinic_name_doctor"/>
|
|
|
+ <result property="clinicStartTime" column="clinic_start_time"/>
|
|
|
+ <result property="clinicEndTime" column="clinic_end_time"/>
|
|
|
+ <result property="clinicStatus" column="clinic_status"/>
|
|
|
+ <result property="patientName" column="patient_name"/>
|
|
|
+ <result property="patientGender" column="patient_gender"/>
|
|
|
+ <result property="patientAge" column="patient_age"/>
|
|
|
+ <result property="patientCode" column="patient_code"/>
|
|
|
+ <result property="deptName" column="dept_name"/>
|
|
|
+ <result property="infusionId" column="infusion_id"/>
|
|
|
+ <result property="deviceId" column="device_id"/>
|
|
|
+ <result property="classification" column="classification"/>
|
|
|
+ <result property="totalDose" column="total_dose"/>
|
|
|
+ <result property="firstDose" column="first_dose"/>
|
|
|
+ <result property="remainDose" column="remain_dose"/>
|
|
|
+ <result property="inputDose" column="input_dose"/>
|
|
|
+ <result property="appendDose" column="append_dose"/>
|
|
|
+ <result property="appendLockTime" column="append_lock_time"/>
|
|
|
+ <result property="maxDose" column="max_dose"/>
|
|
|
+ <result property="selfControlCount" column="self_control_count"/>
|
|
|
+ <result property="selfControlLockTime" column="self_control_lock_time"/>
|
|
|
+ <result property="pcaValidCount" column="pca_valid_count"/>
|
|
|
+ <result property="pcaInvalidCount" column="pca_invalid_count"/>
|
|
|
+ <result property="pcaTotalCount" column="pca_total_count"/>
|
|
|
+ <result property="continueDose" column="continue_dose"/>
|
|
|
+ <result property="pulseDose" column="pulse_dose"/>
|
|
|
+ <result property="pulseLockTime" column="pulse_lock_time"/>
|
|
|
+ <result property="pulseFirstLockTime" column="pulse_first_lock_time"/>
|
|
|
+ <result property="flowUpCycle" column="flow_up_cycle"/>
|
|
|
+ <result property="flowDownCycle" column="flow_down_cycle"/>
|
|
|
+ <result property="flowCount" column="flow_count"/>
|
|
|
+ <result property="flowUpLimit" column="flow_up_limit"/>
|
|
|
+ <result property="flowDownLimit" column="flow_down_limit"/>
|
|
|
+ <result property="flowAdjustRate" column="flow_adjust_rate"/>
|
|
|
+ <result property="flowRestricted" column="flow_restricted"/>
|
|
|
+ <result property="warnFlow" column="warn_flow"/>
|
|
|
+ <result property="electricQuantity" column="electric_quantity"/>
|
|
|
+ <result property="deviceRunState" column="device_run_state"/>
|
|
|
+ <result property="deviceAlarm" column="device_alarm"/>
|
|
|
+ <result property="infusionStartTime" column="infusion_start_time"/>
|
|
|
+ <result property="lastUploadTime" column="last_upload_time"/>
|
|
|
+ <result property="deviceType" column="device_type"/>
|
|
|
+ <result property="hospitalCode" column="hospital_code"/>
|
|
|
+ <result property="warnWillFinished" column="warn_will_finished"/>
|
|
|
+ <result property="warnAnalgesicPoor" column="warn_analgesic_poor"/>
|
|
|
+ <result property="warnLowBattery" column="warn_low_battery"/>
|
|
|
+ </resultMap>
|
|
|
+ <select id="selectClinicAndDeviceByClinicId" resultMap="ClinicAndDevice">
|
|
|
+ SELECT
|
|
|
+ bcr.id as clinic_id,
|
|
|
+ bcr.clinic_name,
|
|
|
+ bcr.clinic_name_doctor,
|
|
|
+ bcr.clinic_start_time,
|
|
|
+ bcr.clinic_end_time,
|
|
|
+ bcr.clinic_status,
|
|
|
+ bcr.patient_name,
|
|
|
+ bcr.patient_gender,
|
|
|
+ bcr.patient_age,
|
|
|
+ bcr.dept_name,
|
|
|
+ bcr.patient_code,
|
|
|
+ <include refid="ClinicAndInfusionColumn"/>
|
|
|
+ FROM
|
|
|
+ biz_clinic_room bcr
|
|
|
+ LEFT JOIN biz_infusion_clinic bic ON bcr.ID = bic.clinic_id
|
|
|
+ left join biz_infusion_history bih on bih.id = bic.infusion_id
|
|
|
+ WHERE
|
|
|
+ bcr.id = #{clinicId}
|
|
|
+ </select>
|
|
|
+ <sql id="ClinicAndQuestionAnswerColumn">
|
|
|
+ bqa.id as question_answer_id,bqa.content,bqa.question,bqa.question_group_id,bqa.send_time,bqa.answer_time,bqa.deleted,bqa.question_type
|
|
|
+ </sql>
|
|
|
+ <resultMap id="ClinicAndQuestionAnswer" type="cn.tr.module.smart.common.vo.BizClinicAndQuestionVO">
|
|
|
+ <result property="clinicId" column="clinic_id"/>
|
|
|
+ <result property="clinicName" column="clinic_name"/>
|
|
|
+ <result property="clinicNameDoctor" column="clinic_name_doctor"/>
|
|
|
+ <result property="clinicStartTime" column="clinic_start_time"/>
|
|
|
+ <result property="clinicEndTime" column="clinic_end_time"/>
|
|
|
+ <result property="clinicStatus" column="clinic_status"/>
|
|
|
+ <result property="patientName" column="patient_name"/>
|
|
|
+ <result property="patientGender" column="patient_gender"/>
|
|
|
+ <result property="patientAge" column="patient_age"/>
|
|
|
+ <result property="patientCode" column="patient_code"/>
|
|
|
+ <result property="deptName" column="dept_name"/>
|
|
|
+ <result property="questionAnswerId" column="question_answer_id"/>
|
|
|
+ <result property="content" column="content" typeHandler="cn.tr.module.smart.app.config.ContentListType"/>
|
|
|
+ <result property="question" column="question" typeHandler="cn.tr.module.smart.app.config.QuestionListType"/>
|
|
|
+ <result property="questionGroupId" column="question_group_id"/>
|
|
|
+ <result property="sendTime" column="send_time"/>
|
|
|
+ <result property="answerTime" column="answer_time"/>
|
|
|
+ <result property="questionType" column="question_type"/>
|
|
|
+ </resultMap>
|
|
|
+ <select id="selectClinicAndQuestionByClinicId" resultMap="ClinicAndQuestionAnswer">
|
|
|
+ SELECT
|
|
|
+ bcr.ID AS clinic_id,
|
|
|
+ bcr.clinic_name,
|
|
|
+ bcr.clinic_name_doctor,
|
|
|
+ bcr.clinic_start_time,
|
|
|
+ bcr.clinic_end_time,
|
|
|
+ bcr.clinic_status,
|
|
|
+ bcr.patient_name,
|
|
|
+ bcr.patient_gender,
|
|
|
+ bcr.patient_age,
|
|
|
+ bcr.dept_name,
|
|
|
+ bcr.patient_code,
|
|
|
+ <include refid="ClinicAndQuestionAnswerColumn"/>
|
|
|
+ FROM
|
|
|
+ biz_clinic_room bcr
|
|
|
+ LEFT JOIN biz_question_answer bqa ON bcr.ID = bqa.clinic_id
|
|
|
+ WHERE
|
|
|
+ bcr.id = #{clinicId}
|
|
|
+ ORDER BY
|
|
|
+ bqa.answer_time desc
|
|
|
+ LIMIT 1
|
|
|
+ </select>
|
|
|
+ <sql id="ClinicAndAssessmentColumn">
|
|
|
+ bpa.id as assessment_id,bpa.resting_pain,bpa.movement_pain,bpa.pain_last,bpa.flare_up_frequency,
|
|
|
+ bpa.flare_up_duration,bpa.sleep_status,bpa.mental_status,bpa.appetite_status,bpa.nausea_vomiting,
|
|
|
+ bpa.itching,bpa.dizziness,bpa.throat_pain,bpa.voice_hoarseness,bpa.satisfaction_rating,bpa.pain_nature
|
|
|
+ </sql>
|
|
|
+ <resultMap id="ClinicAndAssessment" type="cn.tr.module.smart.common.vo.BizClinicAndAssessmentVO">
|
|
|
+ <result property="clinicId" column="clinic_id"/>
|
|
|
+ <result property="clinicName" column="clinic_name"/>
|
|
|
+ <result property="clinicNameDoctor" column="clinic_name_doctor"/>
|
|
|
+ <result property="clinicStartTime" column="clinic_start_time"/>
|
|
|
+ <result property="clinicEndTime" column="clinic_end_time"/>
|
|
|
+ <result property="clinicStatus" column="clinic_status"/>
|
|
|
+ <result property="patientName" column="patient_name"/>
|
|
|
+ <result property="patientGender" column="patient_gender"/>
|
|
|
+ <result property="patientAge" column="patient_age"/>
|
|
|
+ <result property="patientCode" column="patient_code"/>
|
|
|
+ <result property="deptName" column="dept_name"/>
|
|
|
+ <result property="assessmentId" column="assessment_id"/>
|
|
|
+ <result property="restingPain" column="resting_pain" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="movementPain" column="movement_pain" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="painLast" column="pain_last" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="flareUpFrequency" column="flare_up_frequency" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="flareUpDuration" column="flare_up_duration" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="sleepStatus" column="sleep_status" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="mentalStatus" column="mental_status" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="appetiteStatus" column="appetite_status" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="nauseaVomiting" column="nausea_vomiting" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="itching" column="itching" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="dizziness" column="dizziness" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="throatPain" column="throat_pain" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="voiceHoarseness" column="voice_hoarseness" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="satisfactionRating" column="satisfaction_rating" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ <result property="painNature" column="pain_nature" typeHandler="cn.tr.module.smart.common.config.PainAssessmentJsonbTypeHandler"/>
|
|
|
+ </resultMap>
|
|
|
+ <select id="selectClinicAndAssessmentByClinicId" resultMap="ClinicAndAssessment">
|
|
|
+ SELECT
|
|
|
+ bcr.id AS clinic_id,
|
|
|
+ bcr.clinic_name,
|
|
|
+ bcr.clinic_name_doctor,
|
|
|
+ bcr.clinic_start_time,
|
|
|
+ bcr.clinic_end_time,
|
|
|
+ bcr.clinic_status,
|
|
|
+ bcr.patient_name,
|
|
|
+ bcr.patient_gender,
|
|
|
+ bcr.patient_age,
|
|
|
+ bcr.dept_name,
|
|
|
+ bcr.patient_code,
|
|
|
+ <include refid="ClinicAndAssessmentColumn"/>
|
|
|
+ FROM
|
|
|
+ biz_clinic_room bcr
|
|
|
+ LEFT JOIN biz_pain_assessment bpa ON bcr.ID = bpa.clinic_id
|
|
|
+ WHERE
|
|
|
+ bcr.id = #{ clinicId }
|
|
|
+ ORDER BY
|
|
|
+ bpa.create_time desc
|
|
|
+ LIMIT 1
|
|
|
+ </select>
|
|
|
</mapper>
|