/*获取某科室在某区间内所有已完成的病历(isDraft为false时),或未完成的病历*/
 public CaseHistory RetrieveSectionCase(DateTime? startDate, DateTime? endDate, bool isDraft, bool showICD) {
     CaseHistory caseHistory = new CaseHistory();
     if (startDate == null) {
         caseHistory.ErrorMessage = "xxc Empty Start Date! @Service";
         return caseHistory;
     }
     else if (endDate == null) {
         caseHistory.ErrorMessage = "ysy Empty End Date! @Service";
         return caseHistory;
     }
     else {
         CaseHistoryEntity  caseHistoryEntity = doctorLogic.RetrieveSectionCase(startDate, endDate, isDraft, showICD);
         TranslateCaseHistoryEntityToCaseHistoryContractData(caseHistoryEntity, caseHistory);
         return caseHistory;
     }
 }
 /*获取指定用户在某区间内所有完成的病历*/
 public CaseHistory GetCaseHistory(string userID, DateTime? startDate, DateTime? endDate, bool showICD) {
     CaseHistory   caseHistory = new CaseHistory();
     if (startDate == null) {
         caseHistory.ErrorMessage = "ccc Empty Start Date! @Service";
         return caseHistory;
     }
     else if (endDate == null) {
         caseHistory.ErrorMessage = "yyy Empty End Date! @Service";
         return caseHistory;
     }
     else {
         CaseHistoryEntity  caseHistoryEntity = doctorLogic.GetCaseHistory(userID, startDate, endDate, showICD);
         TranslateCaseHistoryEntityToCaseHistoryContractData(caseHistoryEntity, caseHistory);
         return caseHistory;
     }
 }
        /*将CaseHistory对应的Entity翻译为数据契约*/
        private void TranslateCaseHistoryEntityToCaseHistoryContractData(
            CaseHistoryEntity caseHistoryEntity,
            CaseHistory caseHistory) {
            caseHistory.ErrorMessage = caseHistoryEntity.ErrorMessage;
            caseHistory.Count = caseHistoryEntity.Count;

            if (caseHistory.Count > 0) {
                caseHistory.caseInfo = new CaseInfo[caseHistory.Count];
                for (int i = 0; i < caseHistory.Count; i++) {
                    caseHistory.caseInfo[i] = new CaseInfo();
                    TranslateCaseInfoEntityToCaseInfoContractData(
                        caseHistoryEntity.caseInfoEntity[i],
                        caseHistory.caseInfo[i]);
                }
            }
        }
 /*获取指定用户在某区间内所有完成的病历*/
 public CaseHistory GetCaseHistory(string userID, string password, DateTime? startDate, DateTime? endDate) {
     UserService userService = new UserService();
     UserInfo userInfo = userService.Login(userID, password);
     if (userInfo.ErrorMessage == null) {
         /*不显示ICD-10编码*/
         return userService.GetCaseHistory(startDate, endDate, false);
     }
     else {
         CaseHistory    caseHistory =  new CaseHistory();
         caseHistory.ErrorMessage = userInfo.ErrorMessage;
         return caseHistory;
     }
 }