|
@ -4,6 +4,7 @@ import com.yihu.hos.config.JsonDateValueProcessor;
|
|
|
import com.yihu.hos.core.constants.MicroServices;
|
|
|
import com.yihu.hos.standard.model.standard.*;
|
|
|
import com.yihu.hos.standard.service.standard.*;
|
|
|
import com.yihu.hos.web.framework.model.Envelop;
|
|
|
import com.yihu.hos.web.framework.model.standard.StandardVersion;
|
|
|
import com.yihu.hos.web.framework.util.controller.BaseController;
|
|
|
import io.swagger.annotations.Api;
|
|
@ -52,7 +53,7 @@ public class StdCenterEndPoint extends BaseController {
|
|
|
private String defaultOrgCode;
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/stdInfo/list",method = RequestMethod.GET)
|
|
|
@RequestMapping(value="/stdInfo/list",method = RequestMethod.GET,produces = "application/json")
|
|
|
@ApiOperation(value = "获取版本列表", produces = "application/json", notes = "获取版本列表")
|
|
|
public String getStdInfo(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
|
|
|
@RequestParam(value = "filters", required = false) String filters) throws ParseException {
|
|
@ -62,7 +63,7 @@ public class StdCenterEndPoint extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/version/list",method = RequestMethod.GET)
|
|
|
@RequestMapping(value="/version/list",method = RequestMethod.GET,produces = "application/json")
|
|
|
@ApiOperation(value = "获取版本号列表", produces = "application/json", notes = "获取版本号列表")
|
|
|
public String getVersions(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
|
|
|
@RequestParam(value = "filters", required = false) String filters) throws ParseException {
|
|
@ -73,7 +74,7 @@ public class StdCenterEndPoint extends BaseController {
|
|
|
return json.toString();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="/dataset/list",method = RequestMethod.GET)
|
|
|
@RequestMapping(value="/dataset/list",method = RequestMethod.GET,produces = "application/json")
|
|
|
@ApiOperation(value = "获取数据集列表", produces = "application/json", notes = "获取数据集列表")
|
|
|
public String getDatasetList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
|
|
|
@RequestParam(value = "filters", required = false) String filters,
|
|
@ -84,7 +85,7 @@ public class StdCenterEndPoint extends BaseController {
|
|
|
return json.toString();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="/metadata/list",method = RequestMethod.GET)
|
|
|
@RequestMapping(value="/metadata/list",method = RequestMethod.GET,produces = "application/json")
|
|
|
@ApiOperation(value = "获取数据元列表", produces = "application/json", notes = "获取数据元列表")
|
|
|
public String getMetadataList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
|
|
|
@RequestParam(value = "filters", required = false) String filters,
|
|
@ -95,7 +96,7 @@ public class StdCenterEndPoint extends BaseController {
|
|
|
return json.toString();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="/dict/list",method = RequestMethod.GET)
|
|
|
@RequestMapping(value="/dict/list",method = RequestMethod.GET,produces = "application/json")
|
|
|
@ApiOperation(value = "获取标准字典列表", produces = "application/json", notes = "获取标准字典列表")
|
|
|
public String getDictList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
|
|
|
@RequestParam(value = "filters", required = false) String filters,
|
|
@ -108,7 +109,7 @@ public class StdCenterEndPoint extends BaseController {
|
|
|
return json.toString();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="/dictItem/list",method = RequestMethod.GET)
|
|
|
@RequestMapping(value="/dictItem/list",method = RequestMethod.GET,produces = "application/json")
|
|
|
@ApiOperation(value = "获取标准字典项列表", produces = "application/json", notes = "获取标准字典项列表")
|
|
|
public String getDictItemList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
|
|
|
@RequestParam(value = "filters", required = false) String filters,
|
|
@ -119,7 +120,7 @@ public class StdCenterEndPoint extends BaseController {
|
|
|
return json.toString();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="/datasetIndex/list",method = RequestMethod.GET)
|
|
|
@RequestMapping(value="/datasetIndex/list",method = RequestMethod.GET,produces = "application/json")
|
|
|
@ApiOperation(value = "获取标准索引列表", produces = "application/json", notes = "获取标准索引列表")
|
|
|
public String getDatasetIndexList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
|
|
|
@RequestParam(value = "filters", required = false) String filters,
|
|
@ -130,7 +131,7 @@ public class StdCenterEndPoint extends BaseController {
|
|
|
return json.toString();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="/relation/list",method = RequestMethod.GET)
|
|
|
@RequestMapping(value="/relation/list",method = RequestMethod.GET,produces = "application/json")
|
|
|
@ApiOperation(value = "获取版本号列表", produces = "application/json", notes = "获取版本号列表")
|
|
|
public String getRelation(@ApiParam(name = "version", value = "版本", defaultValue = "")
|
|
|
@RequestParam(value = "version") String version,
|
|
@ -141,19 +142,89 @@ public class StdCenterEndPoint extends BaseController {
|
|
|
return json.toString();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="/lastDictItem/list",method = RequestMethod.GET)
|
|
|
@RequestMapping(value="/lastDictItem/list",method = RequestMethod.GET, produces = "application/json")
|
|
|
@ApiOperation(value = "根据字典code,获取健康之路最新的字典项", produces = "application/json", notes = "根据字典code,获取健康之路最新的字典项")
|
|
|
public List getLastDictItem(@ApiParam(name = "code", value = "字典code", defaultValue = "")
|
|
|
@RequestParam(value = "code") String code) throws IOException {
|
|
|
public Envelop getLastDictItem(@ApiParam(name = "code", value = "字典code", defaultValue = "")
|
|
|
@RequestParam(value = "code") String code,
|
|
|
@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
|
|
|
@RequestParam(value = "filters", required = false) String filters,
|
|
|
@RequestParam(value = "sorts", required = false) String sorts,
|
|
|
@RequestParam(value = "size", required = false) Integer size,
|
|
|
@RequestParam(value = "page", required = false) Integer page) throws IOException {
|
|
|
List result = new ArrayList();
|
|
|
String ver = standardService.getLastStandByOrgCode(defaultOrgCode);
|
|
|
int total = 0;
|
|
|
String condition = "";
|
|
|
if(StringUtils.isNotBlank(ver)){
|
|
|
List<StdDictionaryModel> list = stdDictService.searchPage(StdDictionaryModel.class, StandardVersion.DictTable,ver, "code="+code, null, null, null,true);
|
|
|
if(CollectionUtils.isNotEmpty(list)){
|
|
|
Long id = list.get(0).getId();
|
|
|
result = stdDictEntryService.searchPage(StdDictionaryEntryModel.class, StandardVersion.DictEntryTable,ver, "dictId="+id, null, null, null,true);
|
|
|
String ids ="";
|
|
|
for (StdDictionaryModel model:list){
|
|
|
ids+= ","+model.getId();
|
|
|
}
|
|
|
ids = ids.substring(1,ids.length());
|
|
|
if(StringUtils.isBlank(filters)){
|
|
|
condition = "dictId="+ids;
|
|
|
}else{
|
|
|
condition = "dictId="+ids+";"+filters;
|
|
|
}
|
|
|
result = stdDictEntryService.searchPage(StdDictionaryEntryModel.class, StandardVersion.DictEntryTable,ver, condition, null, page, size,true);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
Envelop envelop = new Envelop();
|
|
|
envelop.setSuccessFlg(true);
|
|
|
envelop.setDetailModelList(result);
|
|
|
total = stdDictEntryService.searchPage(StdDictionaryEntryModel.class, StandardVersion.DictEntryTable,ver, condition, null, null, null,true).size();
|
|
|
if(size!=null && page!=null && size!=0){
|
|
|
envelop.setCurrPage(page);
|
|
|
envelop.setPageSize(size);
|
|
|
envelop.setTotalPage(total % size > 0 ? total / size + 1 : total / size);
|
|
|
}
|
|
|
envelop.setTotalCount(total);
|
|
|
return envelop;
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="/lastVersionDrug/list",method = RequestMethod.GET, produces = "application/json")
|
|
|
@ApiOperation(value = "去重,获取最新版本号的药品名称", produces = "application/json", notes = "去重,获取最新版本号的药品名称")
|
|
|
public Envelop getLastVersionDrug(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
|
|
|
@RequestParam(value = "filters", required = false) String filters,
|
|
|
@RequestParam(value = "size", required = false) Integer size,
|
|
|
@RequestParam(value = "page", required = false) Integer page) throws IOException {
|
|
|
List result = new ArrayList();
|
|
|
String ver = standardService.getLastStandByOrgCode(defaultOrgCode);
|
|
|
int total = 0;
|
|
|
String condition = "";
|
|
|
if(StringUtils.isNotBlank(ver)){
|
|
|
List<StdDictionaryModel> list = stdDictService.searchPage(StdDictionaryModel.class, StandardVersion.DictTable,ver, "code=STD_MEDICINE,CV08.50.301", null, null, null,true);
|
|
|
if(CollectionUtils.isNotEmpty(list)){
|
|
|
String ids ="";
|
|
|
for (StdDictionaryModel model:list){
|
|
|
ids+= ","+model.getId();
|
|
|
}
|
|
|
ids = ids.substring(1,ids.length());
|
|
|
List<String> fileds = new ArrayList<>();
|
|
|
fileds.add("value");
|
|
|
if(StringUtils.isBlank(filters)){
|
|
|
condition = "dictId="+ids;
|
|
|
}else{
|
|
|
condition = "dictId="+ids+";"+filters;
|
|
|
}
|
|
|
result = stdDictEntryService.searchPage(StdDictionaryEntryModel.class,fileds, StandardVersion.DictEntryTable,ver, condition, null, page, size,true);
|
|
|
}
|
|
|
}
|
|
|
Envelop envelop = new Envelop();
|
|
|
envelop.setSuccessFlg(true);
|
|
|
envelop.setDetailModelList(result);
|
|
|
List<String> fileds = new ArrayList<>();
|
|
|
fileds.add("value");
|
|
|
total = stdDictEntryService.searchPage(StdDictionaryEntryModel.class, fileds, StandardVersion.DictEntryTable, ver, condition, null, null, null, true).size();
|
|
|
if(size!=null && page!=null && size!=0){
|
|
|
envelop.setCurrPage(page);
|
|
|
envelop.setPageSize(size);
|
|
|
envelop.setTotalPage(total % size > 0 ? total / size + 1 : total / size);
|
|
|
}
|
|
|
envelop.setTotalCount(total);
|
|
|
return envelop;
|
|
|
}
|
|
|
}
|