|
|
@@ -1,12 +1,15 @@
|
|
1
|
1
|
using CHEER.PresentationLayer;
|
|
2
|
2
|
using Microsoft.CodeDom.Providers.DotNetCompilerPlatform;
|
|
3
|
3
|
using Newtonsoft.Json;
|
|
|
4
|
+using Newtonsoft.Json.Linq;
|
|
|
5
|
+using RMYY_CallCenter_Api.DB;
|
|
4
|
6
|
using RMYY_CallCenter_Api.Utility;
|
|
5
|
7
|
using System;
|
|
6
|
8
|
using System.CodeDom;
|
|
7
|
9
|
using System.CodeDom.Compiler;
|
|
8
|
10
|
using System.Collections;
|
|
9
|
11
|
using System.Collections.Generic;
|
|
|
12
|
+using System.Data;
|
|
10
|
13
|
using System.IO;
|
|
11
|
14
|
using System.Linq;
|
|
12
|
15
|
using System.Net;
|
|
|
@@ -54,7 +57,7 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
54
|
57
|
public ActionResult GetModelList(string zsyh="",string hzxm="",string sfzh=""
|
|
55
|
58
|
,string zlkh="",string jzlx="",string jzh="",string lxdh="")
|
|
56
|
59
|
{
|
|
57
|
|
- return Content(MODELLIST);
|
|
|
60
|
+ return Content(MODELLIST);
|
|
58
|
61
|
Dictionary<string, string> values = new Dictionary<string, string>();
|
|
59
|
62
|
values.Add("zsyh", zsyh);//主索引号
|
|
60
|
63
|
values.Add("hzxm", hzxm);//患者姓名
|
|
|
@@ -166,24 +169,416 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
166
|
169
|
"rdID\":\"0528\"},\"AdmitDateTime\":\"2019-11-14 09:29:45\",\"Diagnosis\":\"\"}]},\"patientPhones\":{\"PatientPhone\":{\"AddressTy" +
|
|
167
|
170
|
"pe\":\"H\",\"EquipmentType\":\"PH\",\"CountryCode\":null,\"AreaCode\":null,\"PhoneNumber\":\"1383" +
|
|
168
|
171
|
"8393405\",\"Extension\":null,\"Email\":null}}}}";
|
|
169
|
|
- private string ic = "{\"QueryPatientVisitByIDResponse\":{\"Ack\":{\"ResultCode\":\"AA\"},\"VisitCount\":\"0\",\"GlobalPID\":\"00001" +
|
|
170
|
|
- "15272\",\"PatientIDs\":{\"PatientID\":[{\"CardID\":\"0000092787\",\"DomainCode\":\"YNKH\",\"Facility\":\"41604745\"},{\"CardID\":\"105" +
|
|
171
|
|
- "019092521499\",\"DomainCode\":\"YNKH\",\"Facility\":\"41604745\"},{\"CardID\":\"105019092521499\",\"DomainCode\":\"PATID_O\",\"Facilit" +
|
|
172
|
|
- "y\":\"41604745\"},{\"CardID\":\"105019092521499\",\"DomainCode\":\"BLH_O\",\"Facility\":\"41604745\"},{\"CardID\":\"41138119830902202" +
|
|
173
|
|
- "0\",\"DomainCode\":\"SN\",\"Facility\":\"41604745\"}]},\"SourcePatient\":{\"FamilyName\":\"阮静\",\"GivenName\":null,\"MiddleName\":nul" +
|
|
174
|
|
- "l,\"DateTimeOfBirth\":\"1983-09-02\",\"Sex\":\"F\"},\"patientVisits\":\"\",\"patientPhones\":{\"PatientPhone\":{\"AddressTyp" +
|
|
175
|
|
- "e\":\"H\",\"EquipmentType\":\"PH\",\"CountryCode\":null,\"AreaCode\":null,\"PhoneNumber\":\"13838393405\",\"Extension\":null,\"Email\":n" +
|
|
176
|
|
- "ull}}}}";
|
|
|
172
|
+ private string ic = "{\"QueryPatientVisitByIDResponse\":{\"Ack\":{\"ResultCode\":\"AA\"},\"VisitCount\":\"1\",\"Glob" +
|
|
|
173
|
+ "alPID\":\"0000117036\",\"PatientIDs\":{\"PatientID\":[{\"CardID\":\"1012839\",\"DomainCode\":\"BLH_I\",\"Facili" +
|
|
|
174
|
+ "ty\":\"41604745\"},{\"CardID\":\"1012839\",\"DomainCode\":\"PATID_I\",\"Facility\":\"41604745\"},{\"CardID\":\"105" +
|
|
|
175
|
+ "019111710114\",\"DomainCode\":\"YNKH\",\"Facility\":\"41604745\"},{\"CardID\":\"105019111710114\",\"DomainC" +
|
|
|
176
|
+ "ode\":\"PATID_O\",\"Facility\":\"41604745\"},{\"CardID\":\"105019111710114\",\"DomainCode\":\"BLH_O\",\"Facili" +
|
|
|
177
|
+ "ty\":\"41604745\"},{\"CardID\":\"130203196206182417\",\"DomainCode\":\"SN\",\"Facility\":\"41604745\"}]},\"SourceP" +
|
|
|
178
|
+ "atient\":{\"FamilyName\":\"易安德\",\"GivenName\":null,\"MiddleName\":null,\"DateTimeOfBirth\":\"1962-06-18\",\"Se" +
|
|
|
179
|
+ "x\":\"M\"},\"patientVisits\":{\"patientVisit\":{\"VisitNumber\":{\"CardID\":\"113580531\",\"DomainCode\":\"JZH" +
|
|
|
180
|
+ "_E\",\"Facility\":\"41604745\",\"FacilityName\":\"郑州人民医院\"},\"PatientClass\":\"E\",\"AssignedPatientLocati" +
|
|
|
181
|
+ "on\":{\"PointOfCare\":\"11276\",\"Bed\":\"0\",\"PointOfCareName\":\"急诊科(东)\"},\"AttendingDoctor\":{\"Family" +
|
|
|
182
|
+ "Name\":\"刘文政\",\"CardID\":\"13189\"},\"AdmittingDoctor\":{\"FamilyName\":\"刘文政\",\"CardID\":\"13189\"},\"Adm" +
|
|
|
183
|
+ "itDateTime\":\"2019-11-17 00:00:00\",\"Diagnosis\":{\"Name\":\"腹痛待查\"}}},\"patientPhones\":{\"PatientPhon" +
|
|
|
184
|
+ "e\":{\"AddressType\":\"H\",\"EquipmentType\":\"PH\",\"CountryCode\":null,\"AreaCode\":null,\"PhoneNumb" +
|
|
|
185
|
+ "er\":\"-\",\"Extension\":null,\"Email\":null}}}}";
|
|
|
186
|
+ public string tc = "{\"QueryPatientVisitByIDResponse\":{\"Ack\":{\"ResultCode\":\"AA\"},\"VisitCount\":\"7\",\"Global" +
|
|
|
187
|
+ "PID\":\"0000118548\",\"PatientIDs\":{\"PatientID\":[{\"CardID\":\"105019092523123\",\"DomainCode\":\"YNKH\",\"Facility\":\"41" +
|
|
|
188
|
+ "604745\"},{\"CardID\":\"105019092523123\",\"DomainCode\":\"PATID_O\",\"Facility\":\"41604745\"},{\"CardID\":\"1050190925" +
|
|
|
189
|
+ "23123\",\"DomainCode\":\"BLH_O\",\"Facility\":\"41604745\"},{\"CardID\":\"0000090582\",\"DomainCode\":\"YNKH\",\"Facility\":\"4" +
|
|
|
190
|
+ "1604745\"},{\"CardID\":\"410122197402162021\",\"DomainCode\":\"SN\",\"Facility\":\"41604745\"}]},\"SourcePatient\":{\"Fami" +
|
|
|
191
|
+ "lyName\":\"道彦玲\",\"GivenName\":null,\"MiddleName\":null,\"DateTimeOfBirth\":\"1974-02-16\",\"Sex\":\"F\"},\"patientVis" +
|
|
|
192
|
+ "its\":{\"patientVisit\":[{\"VisitNumber\":{\"CardID\":\"119080743\",\"DomainCode\":\"JZH_O\",\"Facility\":\"41604745\",\"Fac" +
|
|
|
193
|
+ "ilityName\":\"郑州人民医院\"},\"PatientClass\":\"O\",\"AssignedPatientLocation\":{\"PointOfCare\":\"11218\",\"PointOfCareNa" +
|
|
|
194
|
+ "me\":\"医学美容中心整形门诊(东)\"},\"AttendingDoctor\":{\"FamilyName\":\"李正斌\",\"CardID\":\"0369\",\"DomainCode\":\"BL" +
|
|
|
195
|
+ "H_O\"},\"AdmittingDoctor\":\"\",\"AdmitDateTime\":\"2021-10-03 10:38:14\",\"Diagnosis\":\"\"},{\"VisitNumber\":{\"CardID\":\"1" +
|
|
|
196
|
+ "19079254\",\"DomainCode\":\"JZH_O\",\"Facility\":\"41604745\",\"FacilityName\":\"郑州人民医院\"},\"PatientClass\":\"O\",\"Assi" +
|
|
|
197
|
+ "gnedPatientLocation\":{\"PointOfCare\":\"11218\",\"PointOfCareName\":\"医学美容中心整形门诊(东)\"},\"AttendingDoctor\":{\"Fa" +
|
|
|
198
|
+ "milyName\":\"张会\",\"DomainCode\":\"BLH_O\"},\"AdmittingDoctor\":\"\",\"AdmitDateTime\":\"2021-10-03 00:00:00\",\"Diagno" +
|
|
|
199
|
+ "sis\":\"\"},{\"VisitNumber\":{\"CardID\":\"118939978\",\"DomainCode\":\"JZH_O\",\"Facility\":\"41604745\",\"FacilityName\":\"郑" +
|
|
|
200
|
+ "州人民医院\"},\"PatientClass\":\"O\",\"AssignedPatientLocation\":{\"PointOfCare\":\"11266\",\"PointOfCareName\":\"妇科门" +
|
|
|
201
|
+ "诊(东)\"},\"AttendingDoctor\":{\"FamilyName\":\"苏倩倩\",\"CardID\":\"3577\",\"DomainCode\":\"BLH_O\"},\"AdmittingDoct" +
|
|
|
202
|
+ "or\":\"\",\"AdmitDateTime\":\"2021-09-19 11:27:49\",\"Diagnosis\":{\"Code\":\"N92.603;N73.902;\",\"Name\":\"月经紊乱;盆腔炎;宫" +
|
|
|
203
|
+ "颈息肉\"}},{\"VisitNumber\":{\"CardID\":\"118939134\",\"DomainCode\":\"JZH_O\",\"Facility\":\"41604745\",\"FacilityN" +
|
|
|
204
|
+ "ame\":\"郑州人民医院\"},\"PatientClass\":\"O\",\"AssignedPatientLocation\":{\"PointOfCare\":\"11218\",\"PointOfCareName\":\"医" +
|
|
|
205
|
+ "学美容中心整形门诊(东)\"},\"AttendingDoctor\":{\"FamilyName\":\"李正斌\",\"CardID\":\"0369\",\"DomainCode\":\"BLH_O\"},\"Admit" +
|
|
|
206
|
+ "tingDoctor\":\"\",\"AdmitDateTime\":\"2021-09-19 09:32:02\",\"Diagnosis\":{\"Code\":\"R22.903\",\"Name\":\"皮肤肿物\"}},{\"Vis" +
|
|
|
207
|
+ "itNumber\":{\"CardID\":\"113582421\",\"DomainCode\":\"JZH_O\",\"Facility\":\"41604745\",\"FacilityName\":\"郑州人民医院\"},\"P" +
|
|
|
208
|
+ "atientClass\":\"O\",\"AssignedPatientLocation\":\"\",\"AttendingDoctor\":{\"FamilyName\":\"武永娟\",\"CardID\":\"2945\"},\"Adm" +
|
|
|
209
|
+ "ittingDoctor\":{\"FamilyName\":\"武永娟\",\"CardID\":\"2945\"},\"AdmitDateTime\":\"2019-11-20 15:00:08\",\"Diagnos" +
|
|
|
210
|
+ "is\":\"\"},{\"VisitNumber\":{\"CardID\":\"118938833\",\"DomainCode\":\"JZH_O\",\"Facility\":\"41604745\",\"Facil" +
|
|
|
211
|
+ "ityName\":\"郑州人民医院\"},\"PatientClass\":\"O\",\"AssignedPatientLocation\":{\"PointOfCare\":\"11258\",\"PointOfCareNa" +
|
|
|
212
|
+ "me\":\"普通外科门诊(东)\"},\"AttendingDoctor\":{\"FamilyName\":\"季节\",\"CardID\":\"12290\"},\"AdmittingDoctor\":\"\",\"Dia" +
|
|
|
213
|
+ "gnosis\":\"\"},{\"VisitNumber\":{\"CardID\":\"118938982\",\"DomainCode\":\"JZH_O\",\"Facility\":\"41604745\",\"FacilityNam" +
|
|
|
214
|
+ "e\":\"郑州人民医院\"},\"PatientClass\":\"O\",\"AssignedPatientLocation\":{\"PointOfCare\":\"11218\",\"PointOfCareName\":\"医学" +
|
|
|
215
|
+ "美容中心整形门诊(东)\"},\"AttendingDoctor\":{\"FamilyName\":\"李正斌\",\"CardID\":\"13549\"},\"AdmittingDoctor\":\"\",\"Diag" +
|
|
|
216
|
+ "nosis\":\"\"}]},\"patientPhones\":{\"PatientPhone\":{\"AddressType\":\"H\",\"EquipmentType\":\"PH\",\"CountryCode\":null,\"Are" +
|
|
|
217
|
+ "aCode\":null,\"PhoneNumber\":\"15838202349\",\"Extension\":null,\"Email\":null}}}}";
|
|
177
|
218
|
|
|
|
219
|
+
|
|
178
|
220
|
|
|
|
221
|
+ public class QueryPatientVisitByIDResponse
|
|
|
222
|
+ {
|
|
|
223
|
+ //AA-成功,NF-不存在,AE-错误,AR-拒绝
|
|
|
224
|
+ public Ack Ack { set; get; }
|
|
|
225
|
+ //就诊记录总数
|
|
|
226
|
+ public string VisitCount { set; get; }
|
|
|
227
|
+ //患者主索引号
|
|
|
228
|
+ public string GlobalPID { set; get; }
|
|
|
229
|
+ public SourcePatient SourcePatient { set; get; }
|
|
|
230
|
+ public patientPhones patientPhones { set; get; }
|
|
|
231
|
+ public PatientIDs PatientIDs { set; get; }
|
|
|
232
|
+ public patientVisits patientVisits { set; get; }
|
|
|
233
|
+ }
|
|
|
234
|
+ public class PatientIDs
|
|
|
235
|
+ {
|
|
|
236
|
+ public List <PatientID> PatientID { set; get; }
|
|
|
237
|
+ }
|
|
|
238
|
+ public class PatientID
|
|
|
239
|
+ {
|
|
|
240
|
+ /// <summary>
|
|
|
241
|
+ /// 标识符
|
|
|
242
|
+ /// </summary>
|
|
|
243
|
+ public string CardID { set; get; }
|
|
|
244
|
+ /// <summary>
|
|
|
245
|
+ /// 标识符类型(SN身份证号)
|
|
|
246
|
+ /// </summary>
|
|
|
247
|
+ public string DomainCode { set; get; }
|
|
|
248
|
+ /// <summary>
|
|
|
249
|
+ /// 院区代码
|
|
|
250
|
+ /// </summary>
|
|
|
251
|
+ public string Facility { set; get; }
|
|
|
252
|
+ }
|
|
|
253
|
+ public class Ack
|
|
|
254
|
+ {
|
|
|
255
|
+ public string ResultCode { set; get; }
|
|
|
256
|
+ }
|
|
179
|
257
|
|
|
180
|
|
- public ActionResult GetRcord(string starttime, string endtime, string PatientClass, string GlobalPID, string Facility)
|
|
|
258
|
+ public class patientPhones
|
|
181
|
259
|
{
|
|
|
260
|
+ public PatientPhone PatientPhone { set; get; }
|
|
|
261
|
+ }
|
|
|
262
|
+ public class patientlistPhones
|
|
|
263
|
+ {
|
|
|
264
|
+ public List <PatientPhone> PatientPhone { set; get; }
|
|
|
265
|
+ }
|
|
|
266
|
+ public class PatientPhone
|
|
|
267
|
+ {
|
|
|
268
|
+ /// <summary>
|
|
|
269
|
+ /// 电话号码
|
|
|
270
|
+ /// </summary>
|
|
|
271
|
+ public string PhoneNumber { set; get; }
|
|
|
272
|
+ }
|
|
|
273
|
+ public class patientVisits
|
|
|
274
|
+ {
|
|
|
275
|
+ public patientVisit patientVisit { set; get; }
|
|
|
276
|
+ }
|
|
|
277
|
+ public class patientlistVisits
|
|
|
278
|
+ {
|
|
|
279
|
+ public List<patientVisit> patientVisit { set; get; }
|
|
|
280
|
+ }
|
|
|
281
|
+ public class patientVisit
|
|
|
282
|
+ {
|
|
|
283
|
+ public VisitNumber VisitNumber { set; get; }
|
|
|
284
|
+ /// <summary>
|
|
|
285
|
+ /// I-入院,O-门诊,E-急诊
|
|
|
286
|
+ /// </summary>
|
|
|
287
|
+ public string PatientClass { set; get; }
|
|
|
288
|
+ /// <summary>
|
|
|
289
|
+ /// 医疗点
|
|
|
290
|
+ /// </summary>
|
|
|
291
|
+ public AssignedPatientLocation AssignedPatientLocation { set; get; }
|
|
|
292
|
+ /// <summary>
|
|
|
293
|
+ /// 接诊医生
|
|
|
294
|
+ /// </summary>
|
|
|
295
|
+ public AttendingDoctor AttendingDoctor { set; get; }
|
|
|
296
|
+ /// <summary>
|
|
|
297
|
+ /// 入院医生
|
|
|
298
|
+ /// </summary>
|
|
|
299
|
+ public AdmittingDoctor AdmittingDoctor { set; get; }
|
|
|
300
|
+ /// <summary>
|
|
|
301
|
+ /// 门诊就诊日期,入院日期
|
|
|
302
|
+ /// </summary>
|
|
|
303
|
+ public string AdmitDateTime { set; get; }
|
|
|
304
|
+ public Diagnosis Diagnosis { set; get; }
|
|
|
305
|
+ }
|
|
|
306
|
+ public class Diagnosis
|
|
|
307
|
+ {
|
|
|
308
|
+ /// <summary>
|
|
|
309
|
+ /// 诊断代码
|
|
|
310
|
+ /// </summary>
|
|
|
311
|
+ public string Code { set; get; }
|
|
|
312
|
+ /// <summary>
|
|
|
313
|
+ /// 诊断名称
|
|
|
314
|
+ /// </summary>
|
|
|
315
|
+ public string Name { set; get; }
|
|
|
316
|
+ }
|
|
|
317
|
+ public class AdmittingDoctor
|
|
|
318
|
+ {
|
|
|
319
|
+ /// <summary>
|
|
|
320
|
+ /// 入院医生姓名
|
|
|
321
|
+ /// </summary>
|
|
|
322
|
+ public string FamilyName { set; get; }
|
|
|
323
|
+ /// <summary>
|
|
|
324
|
+ /// 入院医生工号
|
|
|
325
|
+ /// </summary>
|
|
|
326
|
+ public string CardID { set; get; }
|
|
|
327
|
+ }
|
|
|
328
|
+ public class AttendingDoctor
|
|
|
329
|
+ {
|
|
|
330
|
+ /// <summary>
|
|
|
331
|
+ ///接诊医生姓名
|
|
|
332
|
+ /// </summary>
|
|
|
333
|
+ public string FamilyName { set; get; }
|
|
|
334
|
+ /// <summary>
|
|
|
335
|
+ /// 接诊医生工号
|
|
|
336
|
+ /// </summary>
|
|
|
337
|
+ public string CardID { set; get; }
|
|
|
338
|
+ }
|
|
|
339
|
+ public class AssignedPatientLocation
|
|
|
340
|
+ {
|
|
|
341
|
+ /// <summary>
|
|
|
342
|
+ /// 医疗点,科室代码
|
|
|
343
|
+ /// </summary>
|
|
|
344
|
+ public string PointOfCare { set; get; }
|
|
|
345
|
+ /// <summary>
|
|
|
346
|
+ /// 科室名称
|
|
|
347
|
+ /// </summary>
|
|
|
348
|
+ public string PointOfCareName { set; get; }
|
|
|
349
|
+ }
|
|
|
350
|
+ public class VisitNumber
|
|
|
351
|
+ {
|
|
|
352
|
+ /// <summary>
|
|
|
353
|
+ /// 就诊号
|
|
|
354
|
+ /// </summary>
|
|
|
355
|
+ public string CardID { set; get; }
|
|
|
356
|
+ /// <summary>
|
|
|
357
|
+ /// 就诊号类型
|
|
|
358
|
+ /// </summary>
|
|
|
359
|
+ public string DomainCode { set; get; }
|
|
|
360
|
+ /// <summary>
|
|
|
361
|
+ /// 医疗机构代码
|
|
|
362
|
+ /// </summary>
|
|
|
363
|
+ public string Facility { set; get; }
|
|
|
364
|
+ /// <summary>
|
|
|
365
|
+ /// 医疗机构名称
|
|
|
366
|
+ /// </summary>
|
|
|
367
|
+ public string FacilityName { set; get; }
|
|
|
368
|
+ }
|
|
|
369
|
+ public class SourcePatient
|
|
|
370
|
+ {
|
|
|
371
|
+ public string FamilyName { set; get; }//姓名
|
|
|
372
|
+ public string DateTimeOfBirth { set; get; }//出生日期
|
|
|
373
|
+ public string Sex { set; get; }//性别F女性M男性U未知
|
|
|
374
|
+ }
|
|
182
|
375
|
|
|
183
|
|
- if (PatientClass== "O")
|
|
184
|
|
- return Content(rc );
|
|
|
376
|
+ public ActionResult GetRcord(string starttime, string endtime, string PatientClass, string GlobalPID, string Facility)
|
|
|
377
|
+ {
|
|
|
378
|
+ string str = "";
|
|
|
379
|
+ if (PatientClass == "O")
|
|
|
380
|
+ str = rc;
|
|
|
381
|
+ else if (PatientClass == "I")
|
|
|
382
|
+ str = ic;
|
|
185
|
383
|
else
|
|
186
|
|
- return Content(ic);
|
|
|
384
|
+ str = tc;
|
|
|
385
|
+
|
|
|
386
|
+ var jo = (JObject )JsonConvert.DeserializeObject(str ) ;
|
|
|
387
|
+ var QueryPatientVisitByIDResponse = (JObject)JsonConvert.DeserializeObject(jo["QueryPatientVisitByIDResponse"]
|
|
|
388
|
+ .ToString ());
|
|
|
389
|
+ var Ack= JsonConvert.DeserializeObject<Ack >(QueryPatientVisitByIDResponse["Ack"].ToString ());
|
|
|
390
|
+ if (Ack.ResultCode =="AA"&&int .Parse ( QueryPatientVisitByIDResponse["VisitCount"].ToString ())>0)
|
|
|
391
|
+ {
|
|
|
392
|
+ string F_GlobalPID = QueryPatientVisitByIDResponse["GlobalPID"].ToString ();//患者主索引号
|
|
|
393
|
+ string F_CardID = "";string F_PhoneNumber = "";
|
|
|
394
|
+ string F_FamilyName = "";string F_DateTimeOfBirth = "";string F_Sex = "";
|
|
|
395
|
+
|
|
|
396
|
+ if (QueryPatientVisitByIDResponse["patientVisits"].ToString() != "")
|
|
|
397
|
+ {
|
|
|
398
|
+ if (QueryPatientVisitByIDResponse["PatientIDs"].ToString() != "")
|
|
|
399
|
+ {
|
|
|
400
|
+ var PatientIDs= JsonConvert.DeserializeObject<PatientIDs>(QueryPatientVisitByIDResponse["PatientIDs"].ToString());
|
|
|
401
|
+ if (PatientIDs.PatientID != null && PatientIDs.PatientID.Count > 0)
|
|
|
402
|
+ {
|
|
|
403
|
+ foreach (var it in PatientIDs.PatientID)
|
|
|
404
|
+ {
|
|
|
405
|
+ if (it.DomainCode == "SN")
|
|
|
406
|
+ {
|
|
|
407
|
+ F_CardID = it.CardID;//患者身份证号
|
|
|
408
|
+ }
|
|
|
409
|
+ }
|
|
|
410
|
+ }
|
|
|
411
|
+ if (F_CardID != "")
|
|
|
412
|
+ {
|
|
|
413
|
+ if (QueryPatientVisitByIDResponse["patientPhones"].ToString() != "")
|
|
|
414
|
+ {
|
|
|
415
|
+ try
|
|
|
416
|
+ {
|
|
|
417
|
+ var patientPhones = JsonConvert.DeserializeObject<patientPhones>(QueryPatientVisitByIDResponse["patientPhones"].ToString());
|
|
|
418
|
+ if (patientPhones.PatientPhone != null )
|
|
|
419
|
+ {
|
|
|
420
|
+ F_PhoneNumber = patientPhones.PatientPhone.PhoneNumber;//患者电话号码
|
|
|
421
|
+ }
|
|
|
422
|
+ }catch
|
|
|
423
|
+ {
|
|
|
424
|
+ var patientPhones = JsonConvert.DeserializeObject<patientlistPhones>(QueryPatientVisitByIDResponse["patientPhones"].ToString());
|
|
|
425
|
+ if (patientPhones.PatientPhone != null && patientPhones.PatientPhone.Count
|
|
|
426
|
+ > 0)
|
|
|
427
|
+ {
|
|
|
428
|
+ foreach (var it in patientPhones.PatientPhone)
|
|
|
429
|
+ {
|
|
|
430
|
+ if (!string.IsNullOrEmpty(it.PhoneNumber))
|
|
|
431
|
+ {
|
|
|
432
|
+ F_PhoneNumber = it.PhoneNumber;//患者电话号码
|
|
|
433
|
+ continue;
|
|
|
434
|
+ }
|
|
|
435
|
+ }
|
|
|
436
|
+ }
|
|
|
437
|
+ }
|
|
|
438
|
+
|
|
|
439
|
+ }
|
|
|
440
|
+ if (QueryPatientVisitByIDResponse["SourcePatient"].ToString() != "")
|
|
|
441
|
+ {
|
|
|
442
|
+ var SourcePatient = JsonConvert.DeserializeObject<SourcePatient>(QueryPatientVisitByIDResponse["SourcePatient"].ToString());
|
|
|
443
|
+ F_FamilyName = SourcePatient.FamilyName;//患者姓名
|
|
|
444
|
+ F_DateTimeOfBirth = SourcePatient.DateTimeOfBirth;//患者出生日期
|
|
|
445
|
+ //性别F女性M男性U未知
|
|
|
446
|
+ if (SourcePatient.Sex == "M")//性别
|
|
|
447
|
+ {
|
|
|
448
|
+ F_Sex = "男";
|
|
|
449
|
+ }
|
|
|
450
|
+ else if (SourcePatient.Sex == "F")
|
|
|
451
|
+ {
|
|
|
452
|
+ F_Sex = "女";
|
|
|
453
|
+ }
|
|
|
454
|
+ else
|
|
|
455
|
+ {
|
|
|
456
|
+ F_Sex = "未知";
|
|
|
457
|
+ }
|
|
|
458
|
+
|
|
|
459
|
+ }
|
|
|
460
|
+
|
|
|
461
|
+
|
|
|
462
|
+ if (int.Parse(QueryPatientVisitByIDResponse["VisitCount"].ToString()) > 1)
|
|
|
463
|
+ {
|
|
|
464
|
+ var patientVisits = JsonConvert.DeserializeObject<patientlistVisits>(QueryPatientVisitByIDResponse["patientVisits"].ToString());
|
|
|
465
|
+ foreach (var it in patientVisits.patientVisit)
|
|
|
466
|
+ {
|
|
|
467
|
+ Model.T_Wo_MedicalRecord record = new Model.T_Wo_MedicalRecord();
|
|
|
468
|
+ var sql = $"select count(1) from T_Wo_MedicalRecord where F_JZH='{it.VisitNumber.CardID }'";
|
|
|
469
|
+ var count=Int32 .Parse ( DbHelperSQL.GetSingle(sql).ToString());
|
|
|
470
|
+ if (count > 0)
|
|
|
471
|
+ continue;
|
|
|
472
|
+ else
|
|
|
473
|
+ {
|
|
|
474
|
+ record.F_GlobalPID = F_GlobalPID;//患者主索引号
|
|
|
475
|
+ record.F_CardID = F_CardID;//身份证号
|
|
|
476
|
+ record.F_PhoneNumber = F_PhoneNumber;//电话号码
|
|
|
477
|
+ record.F_FamilyName = F_FamilyName;//患者姓名
|
|
|
478
|
+ record.F_DateTimeOfBirth = F_DateTimeOfBirth;//出生日期
|
|
|
479
|
+ record.F_Sex = F_Sex;//性别
|
|
|
480
|
+ if (it.PatientClass == "I")//就诊类别
|
|
|
481
|
+ record.F_PatientClass = "入院";
|
|
|
482
|
+ else if (it.PatientClass == "O")
|
|
|
483
|
+ record.F_PatientClass = "门诊";
|
|
|
484
|
+ else if (it.PatientClass == "E")
|
|
|
485
|
+ record.F_PatientClass = "急诊";
|
|
|
486
|
+ else if (it.PatientClass == "P")
|
|
|
487
|
+ record.F_PatientClass = "体检";
|
|
|
488
|
+ record.F_FacilityName = it.VisitNumber.FacilityName;//院区
|
|
|
489
|
+ record.F_JZH = it.VisitNumber.CardID ;//就诊号
|
|
|
490
|
+ if (it.AssignedPatientLocation!=null && it.AssignedPatientLocation.ToString ()!="")
|
|
|
491
|
+ record.F_PointOfCareName = it.AssignedPatientLocation.PointOfCareName;//科室名称
|
|
|
492
|
+ if (it.AttendingDoctor != null && it.AttendingDoctor.ToString() != "")
|
|
|
493
|
+ {
|
|
|
494
|
+ record.F_AttendingDoctor = it.AttendingDoctor.FamilyName;//接诊医生姓名
|
|
|
495
|
+ record.F_AttendingDoctorCode = it.AttendingDoctor.CardID ;//接诊医生工号
|
|
|
496
|
+ }
|
|
|
497
|
+ if (it.AdmittingDoctor != null && it.AdmittingDoctor.ToString() != "")
|
|
|
498
|
+ {
|
|
|
499
|
+ record.F_AdmittingDoctor = it.AttendingDoctor.FamilyName;//接诊医生姓名
|
|
|
500
|
+ record.F_AdmittingDoctorCode = it.AttendingDoctor.CardID;//接诊医生工号
|
|
|
501
|
+ }
|
|
|
502
|
+ record.F_AdmitDateTime = it.AdmitDateTime;//门诊就诊日期,入院日期
|
|
|
503
|
+ if (it.Diagnosis != null && it.Diagnosis.ToString() != "")
|
|
|
504
|
+ {
|
|
|
505
|
+ record.F_DiagnosisName = it.Diagnosis.Name;//诊断名称
|
|
|
506
|
+ record.F_DiagnosisCode = it.Diagnosis.Code;//诊断代码
|
|
|
507
|
+ }
|
|
|
508
|
+ new Bll.T_Wo_MedicalRecord().Add(record);
|
|
|
509
|
+ }
|
|
|
510
|
+
|
|
|
511
|
+ }
|
|
|
512
|
+ }
|
|
|
513
|
+ else
|
|
|
514
|
+ {
|
|
|
515
|
+ var patientVisits = JsonConvert.DeserializeObject<patientVisits>(QueryPatientVisitByIDResponse["patientVisits"].ToString());
|
|
|
516
|
+ Model.T_Wo_MedicalRecord record = new Model.T_Wo_MedicalRecord();
|
|
|
517
|
+ if (patientVisits .patientVisit !=null )
|
|
|
518
|
+ {
|
|
|
519
|
+ var it = patientVisits.patientVisit;
|
|
|
520
|
+ var sql = $"select count(1) from T_Wo_MedicalRecord where F_JZH='{it.VisitNumber.CardID }'";
|
|
|
521
|
+ var count = Int32.Parse(DbHelperSQL.GetSingle(sql).ToString());
|
|
|
522
|
+ if (count <=0)
|
|
|
523
|
+ {
|
|
|
524
|
+ record.F_GlobalPID = F_GlobalPID;//患者主索引号
|
|
|
525
|
+ record.F_CardID = F_CardID;//身份证号
|
|
|
526
|
+ record.F_PhoneNumber = F_PhoneNumber;//电话号码
|
|
|
527
|
+ record.F_FamilyName = F_FamilyName;//患者姓名
|
|
|
528
|
+ record.F_DateTimeOfBirth = F_DateTimeOfBirth;//出生日期
|
|
|
529
|
+ record.F_Sex = F_Sex;//性别
|
|
|
530
|
+ if (it.PatientClass == "I")//就诊类别
|
|
|
531
|
+ record.F_PatientClass = "入院";
|
|
|
532
|
+ else if (it.PatientClass == "O")
|
|
|
533
|
+ record.F_PatientClass = "门诊";
|
|
|
534
|
+ else if (it.PatientClass == "E")
|
|
|
535
|
+ record.F_PatientClass = "急诊";
|
|
|
536
|
+ else if (it.PatientClass == "P")
|
|
|
537
|
+ record.F_PatientClass = "体检";
|
|
|
538
|
+ record.F_FacilityName = it.VisitNumber.FacilityName;//院区
|
|
|
539
|
+ record.F_JZH = it.VisitNumber.CardID;//就诊号
|
|
|
540
|
+ if (it.AssignedPatientLocation != null && it.AssignedPatientLocation.ToString() != "")
|
|
|
541
|
+ record.F_PointOfCareName = it.AssignedPatientLocation.PointOfCareName;//科室名称
|
|
|
542
|
+ if (it.AttendingDoctor != null && it.AttendingDoctor.ToString() != "")
|
|
|
543
|
+ {
|
|
|
544
|
+ record.F_AttendingDoctor = it.AttendingDoctor.FamilyName;//接诊医生姓名
|
|
|
545
|
+ record.F_AttendingDoctorCode = it.AttendingDoctor.CardID;//接诊医生工号
|
|
|
546
|
+ }
|
|
|
547
|
+ if (it.AdmittingDoctor != null && it.AdmittingDoctor.ToString() != "")
|
|
|
548
|
+ {
|
|
|
549
|
+ record.F_AdmittingDoctor = it.AttendingDoctor.FamilyName;//接诊医生姓名
|
|
|
550
|
+ record.F_AdmittingDoctorCode = it.AttendingDoctor.CardID;//接诊医生工号
|
|
|
551
|
+ }
|
|
|
552
|
+ record.F_AdmitDateTime = it.AdmitDateTime;//门诊就诊日期,入院日期
|
|
|
553
|
+ if (it.Diagnosis != null && it.Diagnosis.ToString() != "")
|
|
|
554
|
+ {
|
|
|
555
|
+ record.F_DiagnosisName = it.Diagnosis.Name;//诊断名称
|
|
|
556
|
+ record.F_DiagnosisCode = it.Diagnosis.Code;//诊断代码
|
|
|
557
|
+ }
|
|
|
558
|
+ record.F_CreatTime = DateTime.Now;
|
|
|
559
|
+ new Bll.T_Wo_MedicalRecord().Add(record);
|
|
|
560
|
+
|
|
|
561
|
+ }
|
|
|
562
|
+ }
|
|
|
563
|
+
|
|
|
564
|
+
|
|
|
565
|
+ }
|
|
|
566
|
+
|
|
|
567
|
+
|
|
|
568
|
+
|
|
|
569
|
+ }
|
|
|
570
|
+ }
|
|
|
571
|
+ }
|
|
|
572
|
+
|
|
|
573
|
+ }
|
|
|
574
|
+ return Content(str);
|
|
|
575
|
+
|
|
|
576
|
+
|
|
|
577
|
+
|
|
|
578
|
+
|
|
|
579
|
+
|
|
|
580
|
+
|
|
|
581
|
+
|
|
187
|
582
|
|
|
188
|
583
|
HandlePatient service = new HandlePatient();
|
|
189
|
584
|
string xmlText = LoadXmls(starttime, endtime, PatientClass, GlobalPID, Facility);
|
|
|
@@ -238,7 +633,62 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
238
|
633
|
}
|
|
239
|
634
|
|
|
240
|
635
|
|
|
241
|
|
-
|
|
|
636
|
+ public ActionResult GetMedicalRecord()
|
|
|
637
|
+ {
|
|
|
638
|
+ DataTable dt = new DataTable();
|
|
|
639
|
+ string CardID = HttpUtility.UrlDecode(RequestString.GetQueryString("CardID"));
|
|
|
640
|
+ string strpageindex = RequestString.GetQueryString("page");
|
|
|
641
|
+ int pageindex = 1;
|
|
|
642
|
+ string strpagesize = RequestString.GetQueryString("pagesize");
|
|
|
643
|
+ int pagesize = 10;
|
|
|
644
|
+
|
|
|
645
|
+ string sql = string.Empty;
|
|
|
646
|
+
|
|
|
647
|
+ if (CardID.Trim() != "")
|
|
|
648
|
+ {
|
|
|
649
|
+ sql += " and F_CardID = '" + CardID + "'";
|
|
|
650
|
+ }
|
|
|
651
|
+ else
|
|
|
652
|
+ {
|
|
|
653
|
+ var obj1 = new
|
|
|
654
|
+ {
|
|
|
655
|
+ state = "success",
|
|
|
656
|
+ message = "成功",
|
|
|
657
|
+ rows = dt,
|
|
|
658
|
+ total = 0
|
|
|
659
|
+ };
|
|
|
660
|
+ return Content(obj1.ToJson());
|
|
|
661
|
+ }
|
|
|
662
|
+
|
|
|
663
|
+
|
|
|
664
|
+ if (strpageindex.Trim() != "")
|
|
|
665
|
+ {
|
|
|
666
|
+ pageindex = Convert.ToInt32(strpageindex);
|
|
|
667
|
+ }
|
|
|
668
|
+ if (strpagesize.Trim() != "")
|
|
|
669
|
+ {
|
|
|
670
|
+ pagesize = Convert.ToInt32(strpagesize);
|
|
|
671
|
+ }
|
|
|
672
|
+ int recordCount = 0;
|
|
|
673
|
+ dt = Bll.PagerBll.GetListPager(
|
|
|
674
|
+ "T_Wo_MedicalRecord",
|
|
|
675
|
+ "F_ID",
|
|
|
676
|
+ "*",
|
|
|
677
|
+ sql,
|
|
|
678
|
+ "ORDER BY F_ID desc",
|
|
|
679
|
+ pagesize,
|
|
|
680
|
+ pageindex,
|
|
|
681
|
+ true,
|
|
|
682
|
+ out recordCount);
|
|
|
683
|
+ var obj = new
|
|
|
684
|
+ {
|
|
|
685
|
+ state = "success",
|
|
|
686
|
+ message = "成功",
|
|
|
687
|
+ rows = dt,
|
|
|
688
|
+ total = recordCount
|
|
|
689
|
+ };
|
|
|
690
|
+ return Content(obj.ToJson());
|
|
|
691
|
+ }
|
|
242
|
692
|
/// <summary>
|
|
243
|
693
|
/// 实例化WebServices
|
|
244
|
694
|
/// </summary>
|