|
|
@@ -160,8 +160,18 @@ public class EmrServer {
|
|
|
* @return 提示
|
|
|
*/
|
|
|
public ResultVo<Map<String, Object>> insertEmrData(EmrPatientData param) {
|
|
|
+ JSONObject saveJson = new JSONObject();
|
|
|
+ saveJson.put("document", param.getDocumentData());
|
|
|
+
|
|
|
+ try {
|
|
|
+ emr.saveDocument(saveJson);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "病历保存错误,请重试!" + e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
param.setCreateId(TokenUtil.getTokenUserId());
|
|
|
- boolean isUpdated = dao.whetherThereIsAMedicalRecord(param.getPatNo(), param.getTimes(), param.getEmrDocumentId()).equals(1);
|
|
|
+ boolean isUpdated = dao.whetherThereIsAMedicalRecord(param.getEmrDocumentId()).equals(1);
|
|
|
Map<String, Object> extractedData = extractDataElement(param);
|
|
|
if (isUpdated) {
|
|
|
dao.updateCreatedTemplate(param);
|
|
|
@@ -179,6 +189,15 @@ public class EmrServer {
|
|
|
* @return 删除电子病历的同时需要删除, 提取到的数据源.
|
|
|
*/
|
|
|
public ResultVo<List<String>> deletePatientEmrByDocumentId(String documentId) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ emr.deleteEmr(documentId);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "保存病历失败,请重试!" + e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
EmrPatientData patientData = dao.getCategoryCodeByDocumentId(documentId);
|
|
|
EmrDataExtract emrDataExtract = dao.extractDataSource(patientData.getEmrCategoryCode());
|
|
|
List<String> strings = new ArrayList<>();
|