Browse Source

Merge branch 'dev' of yeshijie/patient-co-management into dev

yeshijie 7 years ago
parent
commit
a03b9e3743
17 changed files with 1251 additions and 113 deletions
  1. 2 1
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java
  2. 70 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyCommonDict.java
  3. 88 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDeptDict.java
  4. 65 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDeptStaffAllotDict.java
  5. 109 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDiagnoseClassDict.java
  6. 111 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDiagnoseDict.java
  7. 54 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvOrgPhysicAllotDict.java
  8. 224 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvPhysicDict.java
  9. 146 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvStaffDict.java
  10. 88 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvStaffRegTypeAllotDict.java
  11. 88 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvSubjectClassDict.java
  12. 55 11
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java
  13. 48 51
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/adapter/PresModeAdapter.java
  14. 79 47
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  15. 1 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  16. 21 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java
  17. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

+ 2 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java

@ -121,6 +121,7 @@ public class PrescriptionController extends BaseController{
									@RequestParam(value = "doctor",required = true) String doctor)
	{
		try {
			doctor = "hxmD201703150222";
			String re = prescriptionService.getRecipeTemplate(doctor);
			return Result.success("处方模板获取接口!",re);
@ -142,7 +143,7 @@ public class PrescriptionController extends BaseController{
								@RequestParam(value = "applyTimeEnd",required = false) String applyTimeEnd)
	{
		try {
//			cardNo = "D40612663";
			cardNo = "D40612663";
			String re = prescriptionService.getLastRecipe(cardNo,recipeNo,applyTimeFrom,applyTimeEnd);
			return Result.success("调阅历史处方接口!",re);

+ 70 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyCommonDict.java

@ -0,0 +1,70 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * ZyCommonDict entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "zy_common_dict")
public class ZyCommonDict extends IdEntity implements java.io.Serializable {
    /**
     * '计量单位字典、药品剂型字典、科室类别字典、注射地点字典、皮试类型字典、费别字典、频次字典、药品毒理分类字典、用药方法字典、性别字典的字典结构';
     */
    // Fields
    private String dictName;//字典名称
    private String code;//编码
    private String name;//名称
    // Constructors
    /**
     * default constructor
     */
    public ZyCommonDict() {
    }
    /**
     * full constructor
     */
    public ZyCommonDict(String dictName, String code, String name) {
        this.dictName = dictName;
        this.code = code;
        this.name = name;
    }
    @Column(name = "dict_name", length = 200)
    public String getDictName() {
        return this.dictName;
    }
    public void setDictName(String dictName) {
        this.dictName = dictName;
    }
    @Column(name = "code", length = 50)
    public String getCode() {
        return this.code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "name", length = 200)
    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }
}

+ 88 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDeptDict.java

@ -0,0 +1,88 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * ZyIvDeptDict entity. @author MyEclipse Persistence Tools
 * 科室字典
 */
@Entity
@Table(name = "zy_iv_dept_dict")
public class ZyIvDeptDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String orgCode;//机构编码
	private String deptCode;//科室代码
	private String deptName;//科室名称
	private String deptType;//科室类型  详见科室类型字典中定义
	private String upperDept;//上级科室
	// Constructors
	/** default constructor */
	public ZyIvDeptDict() {
	}
	/** full constructor */
	public ZyIvDeptDict(String orgCode, String deptCode, String deptName,
			String deptType, String upperDept) {
		this.orgCode = orgCode;
		this.deptCode = deptCode;
		this.deptName = deptName;
		this.deptType = deptType;
		this.upperDept = upperDept;
	}
	@Column(name = "org_code", length = 50)
	public String getOrgCode() {
		return this.orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	@Column(name = "dept_code", length = 50)
	public String getDeptCode() {
		return this.deptCode;
	}
	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}
	@Column(name = "dept_name", length = 200)
	public String getDeptName() {
		return this.deptName;
	}
	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}
	@Column(name = "dept_type", length = 50)
	public String getDeptType() {
		return this.deptType;
	}
	public void setDeptType(String deptType) {
		this.deptType = deptType;
	}
	@Column(name = "upper_dept", length = 50)
	public String getUpperDept() {
		return this.upperDept;
	}
	public void setUpperDept(String upperDept) {
		this.upperDept = upperDept;
	}
}

+ 65 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDeptStaffAllotDict.java

@ -0,0 +1,65 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * ZyIvDeptStaffAllotDict entity. @author MyEclipse Persistence Tools
 * 科室员工配置字典
 */
@Entity
@Table(name = "zy_iv_dept_staff_allot_dict")
public class ZyIvDeptStaffAllotDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String orgCode;//机构编码
	private String deptCode;//科室编码
	private String staffCode;//员工编码
	// Constructors
	/** default constructor */
	public ZyIvDeptStaffAllotDict() {
	}
	/** full constructor */
	public ZyIvDeptStaffAllotDict(String orgCode, String deptCode,
			String staffCode) {
		this.orgCode = orgCode;
		this.deptCode = deptCode;
		this.staffCode = staffCode;
	}
	@Column(name = "org_code", length = 50)
	public String getOrgCode() {
		return this.orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	@Column(name = "dept_code", length = 50)
	public String getDeptCode() {
		return this.deptCode;
	}
	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}
	@Column(name = "staff_code", length = 50)
	public String getStaffCode() {
		return this.staffCode;
	}
	public void setStaffCode(String staffCode) {
		this.staffCode = staffCode;
	}
}

+ 109 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDiagnoseClassDict.java

@ -0,0 +1,109 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * ZyIvDiagnoseClassDict entity. @author MyEclipse Persistence Tools
 * 诊断类别字典
 */
@Entity
@Table(name = "zy_iv_diagnose_class_dict")
public class ZyIvDiagnoseClassDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String classSubNo;//类别子序号
	private String classCode;//类别代码
	private String className;//类别名称
	private String upperClass;//上级类别
	private String validFlag;//有效标志  0 :无效;1:有效
	private String spellCode;//拼音首码
	private String wbzxCode;//五笔首码
	// Constructors
	/** default constructor */
	public ZyIvDiagnoseClassDict() {
	}
	/** full constructor */
	public ZyIvDiagnoseClassDict(String classSubNo, String classCode,
			String className, String upperClass, String validFlag,
			String spellCode, String wbzxCode) {
		this.classSubNo = classSubNo;
		this.classCode = classCode;
		this.className = className;
		this.upperClass = upperClass;
		this.validFlag = validFlag;
		this.spellCode = spellCode;
		this.wbzxCode = wbzxCode;
	}
	@Column(name = "class_sub_no", length = 200)
	public String getClassSubNo() {
		return this.classSubNo;
	}
	public void setClassSubNo(String classSubNo) {
		this.classSubNo = classSubNo;
	}
	@Column(name = "class_code", length = 200)
	public String getClassCode() {
		return this.classCode;
	}
	public void setClassCode(String classCode) {
		this.classCode = classCode;
	}
	@Column(name = "class_name", length = 2000)
	public String getClassName() {
		return this.className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	@Column(name = "upper_class", length = 200)
	public String getUpperClass() {
		return this.upperClass;
	}
	public void setUpperClass(String upperClass) {
		this.upperClass = upperClass;
	}
	@Column(name = "valid_flag", length = 50)
	public String getValidFlag() {
		return this.validFlag;
	}
	public void setValidFlag(String validFlag) {
		this.validFlag = validFlag;
	}
	@Column(name = "spell_code", length = 200)
	public String getSpellCode() {
		return this.spellCode;
	}
	public void setSpellCode(String spellCode) {
		this.spellCode = spellCode;
	}
	@Column(name = "wbzx_code", length = 200)
	public String getWbzxCode() {
		return this.wbzxCode;
	}
	public void setWbzxCode(String wbzxCode) {
		this.wbzxCode = wbzxCode;
	}
}

+ 111 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDiagnoseDict.java

@ -0,0 +1,111 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * ZyIvDiagnoseDict entity. @author MyEclipse Persistence Tools
 * 诊断字典表
 */
@Entity
@Table(name = "zy_iv_diagnose_dict")
public class ZyIvDiagnoseDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String diagnoseCode;//诊断代码
	private String diagnoseName;//诊断名称
	private String diagnoseAlias;//诊断别名
	private String diagnoseClass;//诊断类别  详见诊断类别字典定义
	private String validFlag;//有效标志   0 :无效;1:有效
	private String spellCode;//拼音首码
	private String wbzxCode;//五笔首码
	// Constructors
	/** default constructor */
	public ZyIvDiagnoseDict() {
	}
	/** full constructor */
	public ZyIvDiagnoseDict(String diagnoseCode, String diagnoseName,
			String diagnoseAlias, String diagnoseClass, String validFlag,
			String spellCode, String wbzxCode) {
		this.diagnoseCode = diagnoseCode;
		this.diagnoseName = diagnoseName;
		this.diagnoseAlias = diagnoseAlias;
		this.diagnoseClass = diagnoseClass;
		this.validFlag = validFlag;
		this.spellCode = spellCode;
		this.wbzxCode = wbzxCode;
	}
	@Column(name = "diagnose_code", length = 200)
	public String getDiagnoseCode() {
		return this.diagnoseCode;
	}
	public void setDiagnoseCode(String diagnoseCode) {
		this.diagnoseCode = diagnoseCode;
	}
	@Column(name = "diagnose_name", length = 2000)
	public String getDiagnoseName() {
		return this.diagnoseName;
	}
	public void setDiagnoseName(String diagnoseName) {
		this.diagnoseName = diagnoseName;
	}
	@Column(name = "diagnose_alias", length = 2000)
	public String getDiagnoseAlias() {
		return this.diagnoseAlias;
	}
	public void setDiagnoseAlias(String diagnoseAlias) {
		this.diagnoseAlias = diagnoseAlias;
	}
	@Column(name = "diagnose_class", length = 50)
	public String getDiagnoseClass() {
		return this.diagnoseClass;
	}
	public void setDiagnoseClass(String diagnoseClass) {
		this.diagnoseClass = diagnoseClass;
	}
	@Column(name = "valid_flag", length = 50)
	public String getValidFlag() {
		return this.validFlag;
	}
	public void setValidFlag(String validFlag) {
		this.validFlag = validFlag;
	}
	@Column(name = "spell_code", length = 200)
	public String getSpellCode() {
		return this.spellCode;
	}
	public void setSpellCode(String spellCode) {
		this.spellCode = spellCode;
	}
	@Column(name = "wbzx_code", length = 200)
	public String getWbzxCode() {
		return this.wbzxCode;
	}
	public void setWbzxCode(String wbzxCode) {
		this.wbzxCode = wbzxCode;
	}
}

+ 54 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvOrgPhysicAllotDict.java

@ -0,0 +1,54 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * ZyIvOrgPhysicAllotDict entity. @author MyEclipse Persistence Tools
 * 机构药品分发字典
 */
@Entity
@Table(name = "zy_iv_org_physic_allot_dict")
public class ZyIvOrgPhysicAllotDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String orgCode;//机构编码
	private String physicCode;//药品代码
	// Constructors
	/** default constructor */
	public ZyIvOrgPhysicAllotDict() {
	}
	/** full constructor */
	public ZyIvOrgPhysicAllotDict(String orgCode, String physicCode) {
		this.orgCode = orgCode;
		this.physicCode = physicCode;
	}
	@Column(name = "org_code", length = 50)
	public String getOrgCode() {
		return this.orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	@Column(name = "physic_code", length = 50)
	public String getPhysicCode() {
		return this.physicCode;
	}
	public void setPhysicCode(String physicCode) {
		this.physicCode = physicCode;
	}
}

+ 224 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvPhysicDict.java

@ -0,0 +1,224 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * ZyIvPhysicDict entity. @author MyEclipse Persistence Tools
 * 药品字典
 */
@Entity
@Table(name = "zy_iv_physic_dict")
public class ZyIvPhysicDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String physicCode;//药品代码
	private String physicName;//药品名称
	private String physicSpec;//药品规格
	private String subjectClass;//药品科目  科目类别字典中定义
	private String doseUnit;//剂量单位 计量单位字典中定义
	private String quantityUnit;//数量单位  计量单位字典中定义
	private String packUnit;//包装单位   计量单位字典中定义
	private Double minDose;//最小剂量
	private Double packSpec;
	private Double retailPrice;//零售价
	private String physicFrom;//药品剂型  药品剂型字典中定义
	private String toxicologyType;//毒理分类  药品毒理分类字典中定义
	private String basicFlag;//基本药物标志  0:否;1:是
	private String validFlag;//有效标志 0:无效;1:有效
	private String spellCode;//拼音首码
	private String wbzxCode;//五笔首码
	private Integer sequence;//排序号
	// Constructors
	/** default constructor */
	public ZyIvPhysicDict() {
	}
	/** full constructor */
	public ZyIvPhysicDict(String physicCode, String physicName,
			String physicSpec, String subjectClass, String doseUnit,
			String quantityUnit, String packUnit, Double minDose,
			Double packSpec, Double retailPrice, String physicFrom,
			String toxicologyType, String basicFlag, String validFlag,
			String spellCode, String wbzxCode, Integer sequence) {
		this.physicCode = physicCode;
		this.physicName = physicName;
		this.physicSpec = physicSpec;
		this.subjectClass = subjectClass;
		this.doseUnit = doseUnit;
		this.quantityUnit = quantityUnit;
		this.packUnit = packUnit;
		this.minDose = minDose;
		this.packSpec = packSpec;
		this.retailPrice = retailPrice;
		this.physicFrom = physicFrom;
		this.toxicologyType = toxicologyType;
		this.basicFlag = basicFlag;
		this.validFlag = validFlag;
		this.spellCode = spellCode;
		this.wbzxCode = wbzxCode;
		this.sequence = sequence;
	}
	@Column(name = "physic_code", length = 50)
	public String getPhysicCode() {
		return this.physicCode;
	}
	public void setPhysicCode(String physicCode) {
		this.physicCode = physicCode;
	}
	@Column(name = "physic_name", length = 2000)
	public String getPhysicName() {
		return this.physicName;
	}
	public void setPhysicName(String physicName) {
		this.physicName = physicName;
	}
	@Column(name = "physic_spec", length = 2000)
	public String getPhysicSpec() {
		return this.physicSpec;
	}
	public void setPhysicSpec(String physicSpec) {
		this.physicSpec = physicSpec;
	}
	@Column(name = "subject_class", length = 200)
	public String getSubjectClass() {
		return this.subjectClass;
	}
	public void setSubjectClass(String subjectClass) {
		this.subjectClass = subjectClass;
	}
	@Column(name = "dose_unit", length = 50)
	public String getDoseUnit() {
		return this.doseUnit;
	}
	public void setDoseUnit(String doseUnit) {
		this.doseUnit = doseUnit;
	}
	@Column(name = "quantity_unit", length = 50)
	public String getQuantityUnit() {
		return this.quantityUnit;
	}
	public void setQuantityUnit(String quantityUnit) {
		this.quantityUnit = quantityUnit;
	}
	@Column(name = "pack_unit", length = 250)
	public String getPackUnit() {
		return this.packUnit;
	}
	public void setPackUnit(String packUnit) {
		this.packUnit = packUnit;
	}
	@Column(name = "min_dose", precision = 20, scale = 6)
	public Double getMinDose() {
		return this.minDose;
	}
	public void setMinDose(Double minDose) {
		this.minDose = minDose;
	}
	@Column(name = "pack_spec", precision = 20, scale = 6)
	public Double getPackSpec() {
		return this.packSpec;
	}
	public void setPackSpec(Double packSpec) {
		this.packSpec = packSpec;
	}
	@Column(name = "retail_price", precision = 20, scale = 6)
	public Double getRetailPrice() {
		return this.retailPrice;
	}
	public void setRetailPrice(Double retailPrice) {
		this.retailPrice = retailPrice;
	}
	@Column(name = "physic_from", length = 50)
	public String getPhysicFrom() {
		return this.physicFrom;
	}
	public void setPhysicFrom(String physicFrom) {
		this.physicFrom = physicFrom;
	}
	@Column(name = "toxicology_type", length = 250)
	public String getToxicologyType() {
		return this.toxicologyType;
	}
	public void setToxicologyType(String toxicologyType) {
		this.toxicologyType = toxicologyType;
	}
	@Column(name = "basic_flag", length = 50)
	public String getBasicFlag() {
		return this.basicFlag;
	}
	public void setBasicFlag(String basicFlag) {
		this.basicFlag = basicFlag;
	}
	@Column(name = "valid_flag", length = 50)
	public String getValidFlag() {
		return this.validFlag;
	}
	public void setValidFlag(String validFlag) {
		this.validFlag = validFlag;
	}
	@Column(name = "spell_code", length = 200)
	public String getSpellCode() {
		return this.spellCode;
	}
	public void setSpellCode(String spellCode) {
		this.spellCode = spellCode;
	}
	@Column(name = "wbzx_code", length = 200)
	public String getWbzxCode() {
		return this.wbzxCode;
	}
	public void setWbzxCode(String wbzxCode) {
		this.wbzxCode = wbzxCode;
	}
	@Column(name = "sequence")
	public Integer getSequence() {
		return this.sequence;
	}
	public void setSequence(Integer sequence) {
		this.sequence = sequence;
	}
}

+ 146 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvStaffDict.java

@ -0,0 +1,146 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.sql.Timestamp;
import java.util.Date;
/**
 * ZyIvStaffDict entity. @author MyEclipse Persistence Tools
 * 员工字典
 */
@Entity
@Table(name = "zy_iv_staff_dict")
public class ZyIvStaffDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String orgCode;//机构编码
	private String staffCode;//员工编码
	private String staffName;//员工姓名
	private String workCode;//工作牌号
	private Date birthday;//出生日期
	private String sex;//性别  详见基础字典中定义
	private String spellCode;//拼音首码
	private String wbzxCode;//五笔首码
	private String identityNo;//证件号
	private String certificateNo;//从业资格证编号
	// Constructors
	/** default constructor */
	public ZyIvStaffDict() {
	}
	/** full constructor */
	public ZyIvStaffDict(String orgCode, String staffCode, String staffName,
			String workCode, Timestamp birthday, String sex, String spellCode,
			String wbzxCode, String identityNo, String certificateNo) {
		this.orgCode = orgCode;
		this.staffCode = staffCode;
		this.staffName = staffName;
		this.workCode = workCode;
		this.birthday = birthday;
		this.sex = sex;
		this.spellCode = spellCode;
		this.wbzxCode = wbzxCode;
		this.identityNo = identityNo;
		this.certificateNo = certificateNo;
	}
	@Column(name = "org_code", length = 50)
	public String getOrgCode() {
		return this.orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	@Column(name = "staff_code", length = 50)
	public String getStaffCode() {
		return this.staffCode;
	}
	public void setStaffCode(String staffCode) {
		this.staffCode = staffCode;
	}
	@Column(name = "staff_name", length = 50)
	public String getStaffName() {
		return this.staffName;
	}
	public void setStaffName(String staffName) {
		this.staffName = staffName;
	}
	@Column(name = "work_code", length = 50)
	public String getWorkCode() {
		return this.workCode;
	}
	public void setWorkCode(String workCode) {
		this.workCode = workCode;
	}
	@Column(name = "birthday", length = 0)
	public Date getBirthday() {
		return this.birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	@Column(name = "sex", length = 50)
	public String getSex() {
		return this.sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	@Column(name = "spell_code", length = 200)
	public String getSpellCode() {
		return this.spellCode;
	}
	public void setSpellCode(String spellCode) {
		this.spellCode = spellCode;
	}
	@Column(name = "wbzx_code", length = 200)
	public String getWbzxCode() {
		return this.wbzxCode;
	}
	public void setWbzxCode(String wbzxCode) {
		this.wbzxCode = wbzxCode;
	}
	@Column(name = "identity_no", length = 200)
	public String getIdentityNo() {
		return this.identityNo;
	}
	public void setIdentityNo(String identityNo) {
		this.identityNo = identityNo;
	}
	@Column(name = "certificate_no", length = 200)
	public String getCertificateNo() {
		return this.certificateNo;
	}
	public void setCertificateNo(String certificateNo) {
		this.certificateNo = certificateNo;
	}
}

+ 88 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvStaffRegTypeAllotDict.java

@ -0,0 +1,88 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * ZyIvStaffRegTypeAllotDict entity. @author MyEclipse Persistence Tools
 * 员工挂号类型配置字典
 */
@Entity
@Table(name = "zy_iv_staff_reg_type_allot_dict")
public class ZyIvStaffRegTypeAllotDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String orgCode;//机构编码
	private String staffCode;//员工编码
	private Integer registerType;//挂号类型编码
	private String registerTypeName;//挂号类型名称
	private Double registerFee;//挂号费用  挂号费+诊察费
	// Constructors
	/** default constructor */
	public ZyIvStaffRegTypeAllotDict() {
	}
	/** full constructor */
	public ZyIvStaffRegTypeAllotDict(String orgCode, String staffCode,
			Integer registerType, String registerTypeName, Double registerFee) {
		this.orgCode = orgCode;
		this.staffCode = staffCode;
		this.registerType = registerType;
		this.registerTypeName = registerTypeName;
		this.registerFee = registerFee;
	}
	@Column(name = "org_code", length = 50)
	public String getOrgCode() {
		return this.orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	@Column(name = "staff_code", length = 50)
	public String getStaffCode() {
		return this.staffCode;
	}
	public void setStaffCode(String staffCode) {
		this.staffCode = staffCode;
	}
	@Column(name = "register_type")
	public Integer getRegisterType() {
		return this.registerType;
	}
	public void setRegisterType(Integer registerType) {
		this.registerType = registerType;
	}
	@Column(name = "register_type_name", length = 2000)
	public String getRegisterTypeName() {
		return this.registerTypeName;
	}
	public void setRegisterTypeName(String registerTypeName) {
		this.registerTypeName = registerTypeName;
	}
	@Column(name = "register_fee", precision = 20, scale = 6)
	public Double getRegisterFee() {
		return this.registerFee;
	}
	public void setRegisterFee(Double registerFee) {
		this.registerFee = registerFee;
	}
}

+ 88 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvSubjectClassDict.java

@ -0,0 +1,88 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * ZyIvSubjectClassDict entity. @author MyEclipse Persistence Tools
 * 科目类别字典
 */
@Entity
@Table(name = "zy_iv_subject_class_dict")
public class ZyIvSubjectClassDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String classCode;//类别代码
	private String className;//类别名称
	private String upperClass;//上级类别
	private String spellCode;//拼音首码
	private String wbzxCode;//五笔首码
	// Constructors
	/** default constructor */
	public ZyIvSubjectClassDict() {
	}
	/** full constructor */
	public ZyIvSubjectClassDict(String classCode, String className,
			String upperClass, String spellCode, String wbzxCode) {
		this.classCode = classCode;
		this.className = className;
		this.upperClass = upperClass;
		this.spellCode = spellCode;
		this.wbzxCode = wbzxCode;
	}
	@Column(name = "class_code", length = 200)
	public String getClassCode() {
		return this.classCode;
	}
	public void setClassCode(String classCode) {
		this.classCode = classCode;
	}
	@Column(name = "class_name", length = 2000)
	public String getClassName() {
		return this.className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	@Column(name = "upper_class", length = 200)
	public String getUpperClass() {
		return this.upperClass;
	}
	public void setUpperClass(String upperClass) {
		this.upperClass = upperClass;
	}
	@Column(name = "spell_code", length = 200)
	public String getSpellCode() {
		return this.spellCode;
	}
	public void setSpellCode(String spellCode) {
		this.spellCode = spellCode;
	}
	@Column(name = "wbzx_code", length = 200)
	public String getWbzxCode() {
		return this.wbzxCode;
	}
	public void setWbzxCode(String wbzxCode) {
		this.wbzxCode = wbzxCode;
	}
}

+ 55 - 11
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java

@ -20,6 +20,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -33,7 +34,6 @@ import java.util.Map;
 * Created by yeshijie on 2017/8/3.
 */
@Service
@Transactional
public class PrescriptionService extends ZysoftBaseService{
    private static Logger logger = LoggerFactory.getLogger(PrescriptionService.class);
@ -62,6 +62,8 @@ public class PrescriptionService extends ZysoftBaseService{
    private PrescriptionPayDao prescriptionPayDao;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Value("${redisChannel.prescription}")
    private String channelTopic;
@ -93,6 +95,7 @@ public class PrescriptionService extends ZysoftBaseService{
    /**
     * 接收线下处方调整完成消息
     */
    @Transactional
    public Result prescriptionAdjustCompleted(String jsonObject){
        String error = null;
        String status = "1";
@ -183,6 +186,7 @@ public class PrescriptionService extends ZysoftBaseService{
    /**
     * 接收预结算完成消息
     */
    @Transactional
    public Result prePayCompletion(String jsonObject){
        String error = null;
        String status = "1";
@ -348,22 +352,61 @@ public class PrescriptionService extends ZysoftBaseService{
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
        //获取基位医生code
        String jwdoctor = doctorMappingDao.findByDocotrCodeAndJwDoctorHospital(code,hospital);
        String sql = "SELECT dept_code from zy_iv_dept_staff_allot_dict WHERE staff_code = ? and org_code=? ";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql,jwdoctor,hospital);
        String staffCode = null;
        String deptCode = null;
        com.alibaba.fastjson.JSONArray ja = new com.alibaba.fastjson.JSONArray();
        //获取医生不同科室的处方模板
        for(Map<String,Object> map:list){
            Map<String,String> header = new HashMap<>();
            header.put("ORGCODE",hospital);
            header.put("LICENCE",licence);
        Map<String,String> params = new HashMap<>();
        params.put("staffCode",staffCode);
        params.put("deptCode",deptCode);
            Map<String,String> params = new HashMap<>();
            params.put("staffCode",jwdoctor);
            params.put("deptCode",map.get("dept_code").toString());
        String response = postSecond("getRecipeTemplate","处方模板获取接口",params,null,header,false,2);
            String res = postSecond("getRecipeTemplate","处方模板获取接口",params,null,header,false,2);
        return response;
            com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(res);
            ja.add(json);
        }
        //整合成一个json对象
        if(ja.size()==0){
            return null;
        }
        if(ja.size()==1){
            return ja.get(0).toString();
        }
        com.alibaba.fastjson.JSONObject jsonObject = null;
        for(int i =0;i<ja.size();i++){
            com.alibaba.fastjson.JSONObject json = ja.getJSONObject(i);
            if("1".equals(json.getString("CODE"))){
                if(jsonObject==null){
                    jsonObject = json;
                }else {
                    com.alibaba.fastjson.JSONArray returnData = json.getJSONArray("returnData");
                    if(returnData.size()>0){
                        com.alibaba.fastjson.JSONArray jsonArray = jsonObject.getJSONArray("returnData").getJSONArray(0);
                        for(int j=0;j<returnData.getJSONArray(0).size();j++){
                            com.alibaba.fastjson.JSONObject temp = returnData.getJSONArray(0).getJSONObject(j);
                            jsonArray.add(temp);
                        }
                    }
                }
            }
        }
        if(jsonObject==null){
            return ja.get(0).toString();
        }
        return jsonObject.toString();
    }
    /**
     * 调阅历史处方接口
     * @param cardNo 社保卡号
@ -412,6 +455,7 @@ public class PrescriptionService extends ZysoftBaseService{
     * @return
     * @throws Exception
     */
    @Transactional
    public String saveRecipe(String prescriptionCode)  throws Exception
    {
        Prescription prescription = prescriptionDao.findByCode(prescriptionCode);

File diff suppressed because it is too large
+ 48 - 51
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/adapter/PresModeAdapter.java


+ 79 - 47
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.service.app.consult;
import com.yihu.wlyy.adapter.PresModeAdapter;
import com.yihu.wlyy.entity.consult.Consult;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.consult.ConsultTeamDoctor;
@ -35,6 +36,7 @@ import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
import com.yihu.wlyy.service.app.prescription.PrescriptionLogService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.service.third.jw.ZyDictService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
@ -133,6 +135,10 @@ public class ConsultTeamService extends ConsultService {
    private JwPrescriptionService jwPrescriptionService;
    @Autowired
    private PrescriptionInfoService prescriptionInfoService;
    @Autowired
    private PresModeAdapter presModeAdapter;
    @Autowired
    private ZyDictService zyDictService;
    Map<Integer, String> relations = new HashMap<>();
@ -1024,11 +1030,10 @@ public class ConsultTeamService extends ConsultService {
     * @param reason
     * @return
     */
    public String savePrescription(Prescription prescription,String jwCode,Doctor doctor,Patient p,ConsultTeam ct,String reason) throws Exception{
        String re = "";
    public void savePrescription(Prescription prescription,String jwCode,Doctor doctor,Patient p,ConsultTeam ct,String reason) throws Exception{
        //获取智业处方详细
//        String response = jwPrescriptionService.getRecipe(jwCode,p.getSsc());
//        JSONObject jsonObject =
        String response = jwPrescriptionService.getRecipe(jwCode,p.getSsc());
        com.alibaba.fastjson.JSONObject jsonObject = presModeAdapter.modelToSinglePrescription(response);
        //续方主表
        prescription.setCode(getCode());
@ -1049,51 +1054,68 @@ public class ConsultTeamService extends ConsultService {
        prescription.setType(PrescriptionLog.PrescriptionLogType.create.getValue());
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.revieweding.getValue());
        prescription.setConsult(ct.getConsult());
        //保存智业的医生信息
        Map<String,Object> map = zyDictService.findJwDoctorByDoctor(doctor.getCode());
        if(map!=null){
            prescription.setJwDoctorCode(map.get("jw_doctor").toString());
            prescription.setJwHospital(map.get("jw_doctor_hospital").toString());
        }
        prescriptionDao.save(prescription);
        //保存续方药品(处方)信息
        PrescriptionInfo prescriptionInfo = new PrescriptionInfo();
        prescriptionInfo.setPrescriptionCode(prescription.getCode());
        prescriptionInfo.setCode(getCode());
        prescriptionInfo.setDel(1);
        prescriptionInfo.setDirection("口服");//药品用法
        prescriptionInfo.setDrugCode("药品code");//药品code
        prescriptionInfo.setDrugName("药品名称");//药品名称
        prescriptionInfo.setDrugRate("每次1.25mg    q.d.");//吃药频率
        prescriptionInfo.setDrugFormat("2.5mg*80片/盒");//药品规格
        prescriptionInfo.setNum(10);//药品数目
        prescriptionInfo.setPrice(10);//药品单价
        prescriptionInfo.setIsRefrigerate(0);//是否冷藏 1是 0否
        prescriptionInfo.setJwSubCode("");//智业子处方号
        prescriptionInfo.setDrugNumUnit("");//数量单位编码
        prescriptionInfo.setDrugNumUnitName("");//数量单位名称
        prescriptionInfo.setCost(1);//金额
        prescriptionInfo.setCharge(0);//自付
        prescriptionInfo.setBindFlag("0");//成组标志, 0.非成组,1.成组
        prescriptionInfo.setDayCount(2);//用药天数
        prescriptionInfo.setDrugUsage("");//用药方法编码
        prescriptionInfo.setUsageName("");//用药方法名称
        prescriptionInfo.setPhysicDose("");//用药剂量
        prescriptionInfo.setPhysicDoseUnit("");//剂量单位编码
        prescriptionInfo.setPhysicDoseUnitName("");//剂量单位名称
        prescriptionInfo.setPhysicAmount("");//用药总量
        prescriptionInfo.setPhysicAmountUnit("");//总量单位编码
        prescriptionInfo.setPhysicAmountUnitName("");//总量单位名称
        prescriptionInfo.setPhysicInjectPlace("");//注射地点编码
        prescriptionInfo.setPhysicInjectPlaceName("");//注射地点名称
        prescriptionInfo.setPhysicSkinTest("");//注射地点名称
        prescriptionInfo.setPhysicSkinTestName("");//皮试类型名称
        prescriptionInfo.setRemark("");//备注
        prescriptionInfoDao.save(prescriptionInfo);
        com.alibaba.fastjson.JSONArray infos = jsonObject.getJSONArray("prescriptionInfo");
        for(int i=0;i<infos.size();i++){
            com.alibaba.fastjson.JSONObject info = infos.getJSONObject(i);
            PrescriptionInfo prescriptionInfo = new PrescriptionInfo();
            prescriptionInfo.setPrescriptionCode(prescription.getCode());
            prescriptionInfo.setCode(getCode());
            prescriptionInfo.setDel(1);
            prescriptionInfo.setDirection(info.getString("USAGE_NAME"));//药品用法
            prescriptionInfo.setDrugCode(info.getString("drugCode"));//药品code
            prescriptionInfo.setDrugName(info.getString("drugName"));//药品名称
            prescriptionInfo.setDrugRate(info.getString("drugRate"));//吃药频率
            prescriptionInfo.setDrugFormat(info.getString("drugFormat"));//药品规格
            prescriptionInfo.setNum(doubleToInt(info.getDouble("num")));//药品数目
            prescriptionInfo.setPrice(doubleToInt(info.getDouble("price")));//药品单价
            prescriptionInfo.setIsRefrigerate(0);//是否冷藏 1是 0否
            prescriptionInfo.setJwSubCode("");//智业子处方号
            prescriptionInfo.setDrugNumUnit(info.getString("drugNumUnit"));//数量单位编码
            prescriptionInfo.setDrugNumUnitName(info.getString("drugNumUnitName"));//数量单位名称
            prescriptionInfo.setCost(doubleToInt(info.getDouble("cost")));//金额
            prescriptionInfo.setCharge(doubleToInt(info.getDouble("charge")));//自付
            prescriptionInfo.setBindFlag(info.getString("bindFlag"));//成组标志, 0.非成组,1.成组
            prescriptionInfo.setDayCount(info.getInteger("dayCount"));//用药天数
            prescriptionInfo.setDrugUsage(info.getString("drugUsage"));//用药方法编码
            prescriptionInfo.setUsageName(info.getString("usageName"));//用药方法名称
            prescriptionInfo.setPhysicDose(info.getString("physicDose"));//用药剂量
            prescriptionInfo.setPhysicDoseUnit(info.getString("physicDoseUnit"));//剂量单位编码
            prescriptionInfo.setPhysicDoseUnitName(info.getString("physicDoseUnitName"));//剂量单位名称
            prescriptionInfo.setPhysicAmount(info.getString("physicAmount"));//用药总量
            prescriptionInfo.setPhysicAmountUnit(info.getString("physicAmount"));//总量单位编码
            prescriptionInfo.setPhysicAmountUnitName(info.getString("physicAmountUnitName"));//总量单位名称
            prescriptionInfo.setPhysicInjectPlace(info.getString("physicInjectPlace"));//注射地点编码
            prescriptionInfo.setPhysicInjectPlaceName(info.getString("physicInjectPlaceName"));//注射地点名称
            prescriptionInfo.setPhysicSkinTest(info.getString("physicSkinTest"));//注射地点名称
            prescriptionInfo.setPhysicSkinTestName(info.getString("physicSkinTestName"));//皮试类型名称
            prescriptionInfo.setRemark(info.getString("Remark"));//备注
            prescriptionInfoDao.save(prescriptionInfo);
        }
        //保存续方疾病类型
        PrescriptionDiagnosis diagnosis = new PrescriptionDiagnosis();
        diagnosis.setCode("1");
        diagnosis.setPrescriptionCode(prescription.getCode());
        diagnosis.setCreateTime(new Date());
        diagnosis.setName("高血压");
        diagnosis.setUpdateTime(new Date());
        prescriptionDiagnosisDao.save(diagnosis);
        com.alibaba.fastjson.JSONArray jaDiagnosis = jsonObject.getJSONArray("prescriptionDt");
        for (Iterator iterator = jaDiagnosis.iterator(); iterator.hasNext();) {
            com.alibaba.fastjson.JSONObject json = (com.alibaba.fastjson.JSONObject) iterator.next();
            PrescriptionDiagnosis diagnosis = new PrescriptionDiagnosis();
            diagnosis.setCode(json.getString("code"));
            diagnosis.setPrescriptionCode(prescription.getCode());
            diagnosis.setCreateTime(new Date());
            diagnosis.setName(json.getString("name"));
            diagnosis.setHealthProblemName(json.getString("healthProblemName"));
            diagnosis.setHealthProblem(json.getString("healthProblem"));
            diagnosis.setUpdateTime(new Date());
            prescriptionDiagnosisDao.save(diagnosis);
        }
        //保存审核信息
        PrescriptionReviewed reviewed = new PrescriptionReviewed();
@ -1107,11 +1129,21 @@ public class ConsultTeamService extends ConsultService {
        reviewed.setHospitalName(prescription.getHospitalName());
        prescriptionReviewedDao.save(reviewed);
        re +=diagnosis.getName();
        //添加保存日志
        prescriptionLogService.addLog(prescription, PrescriptionLog.PrescriptionLogType.create.getValue(),1,1);
        return re;
    }
    /**
     * double*100转int
     * @param d
     * @return
     */
    private Integer doubleToInt(Double d){
        if(d==null){
            return 0;
        }
        return new Double(d*100).intValue();
    }
    /**

+ 1 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -27,7 +27,6 @@ import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -1061,7 +1060,7 @@ public class PrescriptionInfoService extends BaseService {
     */
    public com.alibaba.fastjson.JSONArray getPrescriptionTemp(String doctor)throws Exception{
        String rp = jwPrescriptionService.getRecipeTemplate(doctor);
        com.alibaba.fastjson.JSONArray rs =  presModeAdapter.modeToPrescription(rp);
        com.alibaba.fastjson.JSONArray rs =  presModeAdapter.modeTopresInfo(rp);
        return rs;
    }
}

+ 21 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java

@ -65,6 +65,27 @@ public class ZyDictService {
        return doctorMappingDao.getDoctorByJw(jwHospital,jwDoctor);
    }
    /**
     * 根据医生code获取
     * @param doctor
     * @return
     */
    public Map<String, Object> findJwDoctorByDoctor(String doctor){
        String sql = "SELECT dm.doctor_code," +
                " dm.jw_doctor," +
                " dm.jw_doctor_name," +
                " dm.jw_doctor_hospital," +
                " dm.jw_doctor_hospital_name" +
                " from wlyy_doctor_mapping dm " +
                " WHERE dm.doctor_code = ? " +
                " ORDER BY dm.id desc";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql,doctor);
        if(list!=null&&list.size()>0){
            return list.get(0);
        }
        return null;
    }
    /**
     * 获取药品字典
     * @param doctor

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -345,7 +345,8 @@ public class PrescriptionInfoController extends BaseController{
    @ApiOperation(value = "获取调整处方模板")
    public String getPrescriptionTemp(){
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getPrescriptionTemp(getUID()));
//            return write(200, "操作成功!", "data",prescriptionInfoService.getPrescriptionTemp(getUID()));
            return write(200, "操作成功!", "data",prescriptionInfoService.getPrescriptionTemp("1"));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");