-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
997 lines (930 loc) · 61.7 KB
/
Copy pathProgram.cs
File metadata and controls
997 lines (930 loc) · 61.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
using Hl7.Fhir.Model;
using Hl7.Fhir.Rest;
using OfficeOpenXml;
using System.Net.Http.Headers;
namespace TestAdultCheck
{
class Program
{
static DataService secret = new DataService();
static LogicModels logic = new LogicModels();
static string root = secret.root;
static async System.Threading.Tasks.Task Main(string[] args)
{
string token = secret.token;
string[] orgIdens = { "2346130016" }; //醫事機構代碼
string fhirserver = secret.fhirserver;
string monthanddate = System.DateTime.Now.ToString("MMdd");
string excelFilePath = root + "台東衛生所成健_" + monthanddate + ".xlsx";
var handler = new AuthorizationMessageHandler();
handler.Authorization = new AuthenticationHeaderValue("Bearer", token);
var client = new FhirClient(fhirserver, FhirClientSettings.CreateDefault(), handler);
FileInfo excelFile = new FileInfo(excelFilePath);
//if (excelFile.Exists)
//{
// excelFile.Delete();
// excelFile = new FileInfo(excelFilePath);
//}
ExcelPackage.LicenseContext = OfficeOpenXml.LicenseContext.NonCommercial;
ExcelPackage package = new ExcelPackage(excelFile);
try
{
foreach (string iden in orgIdens)
{
ExpiredContinue(package, client, iden, "3400", 3402);
//int index = 2;
//string id = logic.GetOrgId(client, iden);
//ExcelWorksheet worksheet = package.Workbook.Worksheets.Add(logic.GetOrgName(iden));
//InitialExcel(worksheet); //初始化: 產生表頭
//var searchParams = new SearchParams();
//searchParams.Add("_total", "accurate");
//searchParams.Add("_sort", "-identifier");
//searchParams.Add("author", "Organization/" + id);
//searchParams.Count = 50;
//Bundle results = client.Search<Composition>(searchParams);
//Console.WriteLine(logic.GetOrgName(iden) + "總比數: " + results.Total);
//int? total = results.Total;
//while (index - 1 <= total)
//{
// foreach (Bundle.EntryComponent entry in results.Entry)
// {
// Composition comp = (Composition)entry.Resource;
// FillExcel(comp, worksheet, index, client, true); //取得資料且寫入excel
// index++;
// }
// results = logic.GetNextPages(results, client, null);
//}
}
package.Save(); //儲存excel
}
catch (Exception e)
{
Console.WriteLine("Error:" + e.Message);
}
finally
{
package.Save(); //儲存excel
}
}
public class AuthorizationMessageHandler : HttpClientHandler
{
public System.Net.Http.Headers.AuthenticationHeaderValue Authorization { get; set; }
protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
if (Authorization != null)
request.Headers.Authorization = Authorization;
return await base.SendAsync(request, cancellationToken);
}
}
public static void ExpiredContinue(ExcelPackage package, FhirClient client,
string iden, string offset, int index)
{
ExcelWorksheet worksheet = package.Workbook.Worksheets[logic.GetOrgName(iden)];
string id = logic.GetOrgId(client, iden);
// 重新抓Page ID
var searchParams = new SearchParams();
searchParams.Add("author", "Organization/" + id);
searchParams.Add("_sort", "-identifier");
searchParams.Add("_total", "accurate");
Bundle results = client.Search<Composition>(searchParams);
Bundle nextPage = logic.GetNextPages(results, client, offset); //指定offset
Console.WriteLine(logic.GetOrgName(iden) + "總比數: " + nextPage.Total);
int? total = nextPage.Total;
while (index - 1 <= total)
{
foreach (Bundle.EntryComponent entry in nextPage.Entry)
{
Composition comp = (Composition)entry.Resource;
FillExcel(comp, worksheet, index, client, true); //取得資料且寫入excel
index++;
}
nextPage = logic.GetNextPages(nextPage, client, null);
}
}
public static void InitialExcel(ExcelWorksheet worksheet)
{
addExcel(worksheet, 1, "姓名", "身分證號", "檢查通知單序號", "病歷號",
"出生日期", "性別", "電話", "醫事機構代號", "第一階段檢查日期", "第二階段檢查日期",
"委託代檢醫事機構代號", "戶籍地", "檢查結果上傳日期", "檢查過B、C型肝炎", "疾病史:高血壓",
"疾病史:糖尿病", "疾病史:高血脂症", "心臟病", "腦中風", "腎臟病", "身高", "體重",
"血壓 -- 收縮壓", "血壓 -- 舒張壓", "高血壓", "三高", "腰圍", "BMI", "吸煙", "喝酒",
"嚼檳榔", "運動", "健康諮詢:戒煙", "健康諮詢:節酒", "健康諮詢:戒檳榔", "健康諮詢:規律運動",
"健康諮詢:維持正常體", "健康諮詢:健康飲食", "健康諮詢:事故傷害預", "健康諮詢:口腔保健",
"B型肝炎表面抗原", "C型肝炎病毒抗體", "感覺情緒低落沮喪", "做事情失去興趣", "尿液--酸鹼值",
"Protein 尿蛋白", "尿糖", "尿沉渣鏡檢", "潛血", "尿液紅血球", "尿液白血球", "尿液上皮細胞",
"Cast", "Bacteria", "Appearance", "高血脂", "膽固醇", "三酸甘油脂", "空腹血糖", "肌酸肝",
"GOT", "GPT", "高密度膽固醇", "低密度脂蛋白膽固醇計", "腎絲球過濾率計算", "B型肝炎表面抗原",
"C型肝炎病毒抗體", "肝功能檢查結果判讀", "血糖檢查結果判讀", "血脂肪檢查結果判讀",
"腎功能檢查結果判讀", "血壓檢查結果與建議", "代謝症候群檢查結果與", "B型肝炎檢查結果與建",
"C型肝炎檢查結果與建", "憂鬱檢測結果與建議", "Composition Id");
}
public static void FillExcel(Composition comp, ExcelWorksheet worksheet, int index, FhirClient client, bool decryp)
{
string com_id = comp.Id;
string name = string.Empty, id = string.Empty, checkNoticeSerialNumber = string.Empty,
medicalRecordNumber = string.Empty, birthDate = string.Empty, gender = string.Empty,
phone = string.Empty, medicalInstitutionCode = string.Empty, firstCheckDate = string.Empty,
secondCheckDate = string.Empty, entrustedAgentMedicalInstitutionCode = string.Empty,
registeredResidence = string.Empty, resultUploadDate = string.Empty,
checkBCTypeHepatitis = string.Empty, hypertensionHistory = "否", diabetesHistory = "否",
hyperlipidemiaHistory = "否", heartDisease = "否", stroke = "否", kidneyDisease = "否",
height = string.Empty, weight = string.Empty, systolicPressure = string.Empty,
diastolicPressure = string.Empty, highBloodPressure = string.Empty, threeHigh = string.Empty,
waistCircumference = string.Empty, BMI = string.Empty, smoking = string.Empty,
alcoholConsumption = string.Empty, betelNutChewing = string.Empty, exercise = string.Empty,
smokingCessationConsultation = string.Empty, alcoholReductionConsultation = string.Empty,
betelNutCessationConsultation = string.Empty, regularExerciseConsultation = string.Empty,
maintainNormalWeightConsultation = string.Empty, healthyDietConsultation = string.Empty,
accidentInjuryPreventionConsultation = string.Empty, oralHealthCareConsultation = string.Empty,
hepatitisBSurfaceAntigen = "未執行", hepatitisCAntibody = "未執行", lowMood = string.Empty,
lossOfInterest = string.Empty, urineAcidityValue = "未執行", urineProtein = string.Empty,
urineSugar = "未執行", urineSedimentMicroscopy = "未執行", occultBlood = "未執行",
urineRedBloodCells = "未執行", urineWhiteBloodCells = "未執行", urineEpithelialCells = "未執行",
cast = "未執行", bacteria = "未執行", appearance = "未執行", hyperlipidemia = string.Empty,
cholesterol = string.Empty, triglycerides = string.Empty, fastingBloodSugar = string.Empty,
creatinine = string.Empty, GOT = string.Empty, GPT = string.Empty,
highDensityLipoproteinCholesterol = string.Empty, lowDensityLipoproteinCholesterol = string.Empty,
glomerularFiltrationRate = string.Empty, bbody = string.Empty, cbody = string.Empty,
liverFunctionResultInterpretation = string.Empty,
bloodSugarResultInterpretation = string.Empty, lipidProfileResultInterpretation = string.Empty,
kidneyFunctionResultInterpretation = string.Empty, bloodPressureResultAndRecommendation = string.Empty,
metabolicSyndromeResultAndRecommendation = string.Empty, hepatitisBResultAndRecommendation = string.Empty,
hepatitisCResultAndRecommendation = string.Empty, depressionDetectionResultAndRecommendation = string.Empty;
//bool checkBCTypeHepatitis_isRed = false, hypertensionHistory_isRed = false,
// diabetesHistory_isRed = false, hyperlipidemiaHistory_isRed = false,
// heartDisease_isRed = false, stroke_isRed = false, kidneyDisease_isRed = false,
// height_isRed = false, weight_isRed = false, systolicPressure_isRed = false,
// diastolicPressure_isRed = false, highBloodPressure_isRed = false, threeHigh_isRed = false,
// waistCircumference_isRed = false, BMI_isRed = false, smoking_isRed = false,
// alcoholConsumption_isRed = false, betelNutChewing_isRed = false, exercise_isRed = false,
// smokingCessationConsultation_isRed = false, alcoholReductionConsultation_isRed = false,
// betelNutCessationConsultation_isRed = false, regularExerciseConsultation_isRed = false,
// maintainNormalWeightConsultation_isRed = false, healthyDietConsultation_isRed = false,
// accidentInjuryPreventionConsultation_isRed = false, oralHealthCareConsultation_isRed = false,
// hepatitisBSurfaceAntigen_isRed = false, hepatitisCAntibody_isRed = false, lowMood_isRed = false,
// lossOfInterest_isRed = false, urineAcidityValue_isRed = false, urineProtein_isRed = false,
// urineSugar_isRed = false, urineSedimentMicroscopy_isRed = false, occultBlood_isRed = false,
// urineRedBloodCells_isRed = false, urineWhiteBloodCells_isRed = false, urineEpithelialCells_isRed = false,
// cast_isRed = false, bacteria_isRed = false, appearance_isRed = false, hyperlipidemia_isRed = false,
// cholesterol_isRed = false, triglycerides_isRed = false, fastingBloodSugar_isRed = false,
// creatinine_isRed = false, GOT_isRed = false, GPT_isRed = false, highDensityLipoproteinCholesterol_isRed = false,
// lowDensityLipoproteinCholesterol_isRed = false, glomerularFiltrationRate_isRed = false, bbody_isRed = false,
// cbody_isRed = false, liverFunctionResultInterpretation_isRed = false, bloodSugarResultInterpretation_isRed = false,
// lipidProfileResultInterpretation_isRed = false, kidneyFunctionResultInterpretation_isRed = false,
// bloodPressureResultAndRecommendation_isRed = false, metabolicSyndromeResultAndRecommendation_isRed = false,
// hepatitisBResultAndRecommendation_isRed = false, hepatitisCResultAndRecommendation_isRed = false,
// depressionDetectionResultAndRecommendation_isRed = false;
string hyperglycemiaTemp = string.Empty;
checkNoticeSerialNumber = comp.Identifier.Value;
string patientId = comp.Subject.Reference.ToString();
Patient pat = client.Read<Patient>(patientId);
if (pat != null)
{
name = decryp ? logic.DecryptStringFromBytes_Aes(pat.Name[0].Text) : pat.Name[0].Text; //姓名
id = logic.GetIdentifierValue(pat, "NNxxx", decryp);
medicalRecordNumber = logic.GetIdentifierValue(pat, "MR", false);
birthDate = pat.BirthDate;
gender = logic.ChangeGender(pat.Gender);
if (pat.Telecom != null && pat.Telecom.Count > 0)
{
phone = decryp ? logic.DecryptStringFromBytes_Aes(pat.Telecom[0].Value) : pat.Telecom[0].Value; //電話
}
if(pat.Address != null && pat.Address.Count > 0)
{
registeredResidence = decryp ? logic.DecryptStringFromBytes_Aes(pat.Address[0].Text) : pat.Address[0].Text;
}
}
string encId = comp.Encounter.Reference.ToString();
Encounter enc = client.Read<Encounter>(encId);
if (enc.StatusHistory != null && enc.StatusHistory.Count > 0)
{
Encounter.StatusHistoryComponent first = enc.StatusHistory[0]; //第一階段檢查日期
if (enc.StatusHistory.Count > 1)
{
Encounter.StatusHistoryComponent second = enc.StatusHistory[1]; //第二階段檢查日期
secondCheckDate = logic.AdToRocEra(second.Period.Start);
}
firstCheckDate = logic.AdToRocEra(first.Period.Start);
}
if (comp.Author != null && comp.Author.Count > 0)
{
string hosId = comp.Author[0].Reference.ToString();
Organization hospital = client.Read<Organization>(hosId);
if(hospital != null)
{
medicalInstitutionCode = logic.GetIdentifierValue(hospital, "PRN");
}
if(comp.Author.Count > 1)
{
string testId = comp.Author[1].Reference.ToString();
Organization test = client.Read<Organization>(testId);
if (test != null)
{
entrustedAgentMedicalInstitutionCode = logic.GetIdentifierValue(test, "PRN");
}
}
}
foreach (var sec in comp.Section)
{
switch (sec.Title)
{
case "疾病史-高血壓":
hypertensionHistory = "是";
break;
case "疾病史-糖尿病":
diabetesHistory = "是";
break;
case "疾病史-高血脂症":
hyperlipidemiaHistory = "是";
break;
case "疾病史-心臟病":
heartDisease = "是";
break;
case "疾病史-腦中風":
stroke = "是";
break;
case "疾病史-腎臟病":
kidneyDisease = "是";
break;
case "生理量測-身高":
string heightId = sec.Entry[0].Reference.ToString();
Observation hei = client.Read<Observation>(heightId);
if (hei.Value is Hl7.Fhir.Model.Quantity heightValue)
{
height = heightValue.Value.ToString();
}
break;
case "生理量測-體重":
string weightId = sec.Entry[0].Reference.ToString();
Observation wei = client.Read<Observation>(weightId);
if (wei.Value is Hl7.Fhir.Model.Quantity weightValue)
{
weight = weightValue.Value.ToString();
}
break;
case "生理量測-BMI":
string bmiId = sec.Entry[0].Reference.ToString();
Observation bmi = client.Read<Observation>(bmiId);
if (bmi.Value is Hl7.Fhir.Model.Quantity bmiValue)
{
BMI = bmiValue.Value.ToString();
}
break;
case "生理量測-血壓":
string bloodPressureId = sec.Entry[0].Reference.ToString();
Observation pb = client.Read<Observation>(bloodPressureId);
foreach (var component in pb.Component)
{
if (component.Code.Coding[0].Code == "8480-6")
{
if (component.Value is Hl7.Fhir.Model.Quantity systolicValue)
{
systolicPressure = systolicValue.Value.ToString();
if (highBloodPressure != "1")
{
highBloodPressure = systolicValue.Value >= 140 ? "1" : "0"; //高血壓: 收縮壓持續處於140 毫米水銀柱(mmHg) 或以上,或舒張壓持續處於90 毫米水銀柱或以上
}
}
}
if (component.Code.Coding[0].Code == "8462-4")
{
if (component.Value is Hl7.Fhir.Model.Quantity diastolicValue)
{
diastolicPressure = diastolicValue.Value.ToString();
if (highBloodPressure != "1")
{
highBloodPressure = diastolicValue.Value >= 90 ? "1" : "0"; //高血壓: 收縮壓持續處於140 毫米水銀柱(mmHg) 或以上,或舒張壓持續處於90 毫米水銀柱或以上
}
}
}
}
break;
case "生理量測-腰圍":
string waistId = sec.Entry[0].Reference.ToString();
Observation waist = client.Read<Observation>(waistId);
if (waist.Value is Hl7.Fhir.Model.Quantity waisyValue)
{
waistCircumference = waisyValue.Value.ToString();
}
break;
case "檢驗檢查-Protein 尿蛋白":
string urineProteinId = sec.Entry[0].Reference.ToString();
Observation urine = client.Read<Observation>(urineProteinId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(urine.Issued.ToString());
}
if (urine.Value is Hl7.Fhir.Model.Quantity upValue)
{
urineProtein = upValue.Value.ToString();
}
break;
case "檢驗檢查-血糖":
string bloodSugarId = sec.Entry[0].Reference.ToString();
Observation sugar = client.Read<Observation>(bloodSugarId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(sugar.Issued.ToString());
}
if (sugar.Value is Hl7.Fhir.Model.Quantity sugarValue)
{
fastingBloodSugar = sugarValue.Value.ToString();
if(hyperglycemiaTemp != "1")
{
if(sugar.ReferenceRange != null && sugar.ReferenceRange.Count > 0)
{
decimal? low = sugar.ReferenceRange[0].Low.Value;
decimal? high = sugar.ReferenceRange[0].High.Value;
hyperglycemiaTemp = (sugarValue.Value < low || sugarValue.Value > high) ? "1" : "0"; //依據上下值判斷
}
}
}
break;
case "檢驗檢查-膽固醇":
string cholesterolId = sec.Entry[0].Reference.ToString();
Observation chol = client.Read<Observation>(cholesterolId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(chol.Issued.ToString());
}
if (chol.Value is Hl7.Fhir.Model.Quantity cholValue)
{
cholesterol = cholValue.Value.ToString();
if (hyperlipidemia != "1")
{
if (chol.ReferenceRange != null && chol.ReferenceRange.Count > 0)
{
decimal? low = chol.ReferenceRange[0].Low.Value;
decimal? high = chol.ReferenceRange[0].High.Value;
hyperlipidemia = (cholValue.Value < low || cholValue.Value > high) ? "1" : "0"; //依據上下值判斷
}
}
}
break;
case "檢驗檢查-三酸甘油脂":
string triglyceridesId = sec.Entry[0].Reference.ToString();
Observation tri = client.Read<Observation>(triglyceridesId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(tri.Issued.ToString());
}
if (tri.Value is Hl7.Fhir.Model.Quantity triValue)
{
triglycerides = triValue.Value.ToString();
if (hyperlipidemia != "1")
{
if (tri.ReferenceRange != null && tri.ReferenceRange.Count > 0)
{
decimal? low = tri.ReferenceRange[0].Low.Value;
decimal? high = tri.ReferenceRange[0].High.Value;
hyperlipidemia = (triValue.Value < low || triValue.Value > high) ? "1" : "0"; //依據上下值判斷
}
}
}
break;
case "檢驗檢查-低密度脂蛋白膽固醇計算":
string ldlCholesterolId = sec.Entry[0].Reference.ToString();
Observation ldlCholesterol = client.Read<Observation>(ldlCholesterolId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(ldlCholesterol.Issued.ToString());
}
if (ldlCholesterol.Value is Hl7.Fhir.Model.Quantity ldlCholesterolValue)
{
lowDensityLipoproteinCholesterol = ldlCholesterolValue.Value.ToString();
}
break;
case "檢驗檢查-高密度膽固醇":
string hdlCholesterolId = sec.Entry[0].Reference.ToString();
Observation hdlCholesterol = client.Read<Observation>(hdlCholesterolId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(hdlCholesterol.Issued.ToString());
}
if (hdlCholesterol.Value is Hl7.Fhir.Model.Quantity hdlCholesterolValue)
{
highDensityLipoproteinCholesterol = hdlCholesterolValue.Value.ToString();
}
break;
case "檢驗檢查-GOT":
string gotId = sec.Entry[0].Reference.ToString();
Observation got = client.Read<Observation>(gotId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(got.Issued.ToString());
}
if (got.Value is Hl7.Fhir.Model.Quantity gotValue)
{
GOT = gotValue.Value.ToString();
}
break;
case "檢驗檢查-GPT":
string gptId = sec.Entry[0].Reference.ToString();
Observation gpt = client.Read<Observation>(gptId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(gpt.Issued.ToString());
}
if (gpt.Value is Hl7.Fhir.Model.Quantity gptValue)
{
GPT = gptValue.Value.ToString();
}
break;
case "檢驗檢查-肌酸酐":
string creatinineId = sec.Entry[0].Reference.ToString();
Observation creat = client.Read<Observation>(creatinineId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(creat.Issued.ToString());
}
if (creat.Value is Hl7.Fhir.Model.Quantity creatinineValue)
{
creatinine = creatinineValue.Value.ToString();
}
break;
case "檢驗檢查-腎絲球過濾率計算":
string egfrId = sec.Entry[0].Reference.ToString();
Observation egfr = client.Read<Observation>(egfrId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(egfr.Issued.ToString());
}
if (egfr.Value is Hl7.Fhir.Model.Quantity egfrValue)
{
glomerularFiltrationRate = egfrValue.Value.ToString();
}
break;
case "檢驗檢查-B型肝炎表面抗原":
string bId = sec.Entry[0].Reference.ToString();
Observation bb = client.Read<Observation>(bId);
if(resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(bb.Issued.ToString());
}
if (bb.Value is Hl7.Fhir.Model.Quantity bValue)
{
bbody = bValue.Value.ToString();
}
break;
case "檢驗檢查-C型肝炎病毒抗體":
string cId = sec.Entry[0].Reference.ToString();
Observation cb = client.Read<Observation>(cId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(cb.Issued.ToString());
}
if (cb.Value is Hl7.Fhir.Model.Quantity cValue)
{
cbody = cValue.Value.ToString();
}
break;
case "憂鬱檢測:感覺情緒低落沮喪與做事情失去興趣":
string depressionId = sec.Entry[0].Reference.ToString();
Observation depression = client.Read<Observation>(depressionId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(depression.Issued.ToString());
}
foreach (var component in depression.Component)
{
if (component.Code.Coding[0].Code == "66446005") //感覺情緒低落沮喪
{
if (component.Value is FhirString depressValue)
{
lowMood = depressValue.ToString();
}
}
if (component.Code.Coding[0].Code == "713566001")
{
if (component.Value is FhirString lossInterestValue)
{
lossOfInterest = lossInterestValue.ToString();
}
}
}
break;
case "生活史-吸煙":
string smokeId = sec.Entry[0].Reference.ToString();
Observation smoke = client.Read<Observation>(smokeId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(smoke.Issued.ToString());
}
if (smoke.Value is FhirString smokeValue)
{
smoking = smokeValue.ToString();
}
break;
case "生活史-喝酒":
string alcoholId = sec.Entry[0].Reference.ToString();
Observation alcohol = client.Read<Observation>(alcoholId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(alcohol.Issued.ToString());
}
if (alcohol.Value is FhirString alcoholValue)
{
alcoholConsumption = alcoholValue.ToString();
}
break;
case "生活史-嚼檳榔":
string betelNutId = sec.Entry[0].Reference.ToString();
Observation betelNut = client.Read<Observation>(betelNutId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(betelNut.Issued.ToString());
}
if (betelNut.Value is FhirString betelNutValue)
{
betelNutChewing = betelNutValue.ToString();
}
break;
case "生活史-運動":
string exerId = sec.Entry[0].Reference.ToString();
Observation exer = client.Read<Observation>(exerId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(exer.Issued.ToString());
}
if (exer.Value is FhirString exerValue)
{
exercise =exerValue.ToString();
}
break;
case "健康諮詢:戒煙":
string quitSmokingConsultationId = sec.Entry[0].Reference.ToString();
Observation quitSmokingConsultation = client.Read<Observation>(quitSmokingConsultationId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(quitSmokingConsultation.Issued.ToString());
}
if (quitSmokingConsultation.Value is FhirString quitSmokingConsultationValue)
{
smokingCessationConsultation = quitSmokingConsultationValue.ToString();
}
break;
case "健康諮詢:節酒":
string alcoholReductionConsultationId = sec.Entry[0].Reference.ToString();
Observation alcoholReduction = client.Read<Observation>(alcoholReductionConsultationId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(alcoholReduction.Issued.ToString());
}
if (alcoholReduction.Value is FhirString alcoholReductionConsultationValue)
{
alcoholReductionConsultation = alcoholReductionConsultationValue.ToString();
}
break;
case "健康諮詢:戒檳榔":
string betelNutCessationConsultationId = sec.Entry[0].Reference.ToString();
Observation betelNutCessation = client.Read<Observation>(betelNutCessationConsultationId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(betelNutCessation.Issued.ToString());
}
if (betelNutCessation.Value is FhirString betelNutCessationConsultationValue)
{
betelNutCessationConsultation = betelNutCessationConsultationValue.ToString();
}
break;
case "健康諮詢:規律運動":
string regularExerciseConsultationId = sec.Entry[0].Reference.ToString();
Observation regularExercise = client.Read<Observation>(regularExerciseConsultationId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(regularExercise.Issued.ToString());
}
if (regularExercise.Value is FhirString regularExerciseConsultationValue)
{
regularExerciseConsultation = regularExerciseConsultationValue.ToString();
}
break;
case "健康諮詢:維持正常體重":
string maintainNormalWeightConsultationId = sec.Entry[0].Reference.ToString();
Observation maintainNormalWeight = client.Read<Observation>(maintainNormalWeightConsultationId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(maintainNormalWeight.Issued.ToString());
}
if (maintainNormalWeight.Value is FhirString maintainNormalWeightConsultationValue)
{
maintainNormalWeightConsultation = maintainNormalWeightConsultationValue.ToString();
}
break;
case "健康諮詢:健康飲食":
string healthyDietConsultationId = sec.Entry[0].Reference.ToString();
Observation healthyDiet = client.Read<Observation>(healthyDietConsultationId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(healthyDiet.Issued.ToString());
}
if (healthyDiet.Value is FhirString healthyDietConsultationValue)
{
healthyDietConsultation = healthyDietConsultationValue.ToString();
}
break;
case "健康諮詢:事故傷害預":
string accidentInjuryPreventionConsultationId = sec.Entry[0].Reference.ToString();
Observation accidentInjuryPrevention = client.Read<Observation>(accidentInjuryPreventionConsultationId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(accidentInjuryPrevention.Issued.ToString());
}
if (accidentInjuryPrevention.Value is FhirString accidentInjuryPreventionConsultationValue)
{
accidentInjuryPreventionConsultation = accidentInjuryPreventionConsultationValue.ToString();
}
break;
case "健康諮詢:口腔保健":
string oralHealthCareConsultationId = sec.Entry[0].Reference.ToString();
Observation oralHealthCare = client.Read<Observation>(oralHealthCareConsultationId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(oralHealthCare.Issued.ToString());
}
if (oralHealthCare.Value is FhirString oralHealthCareConsultationValue)
{
oralHealthCareConsultation = oralHealthCareConsultationValue.ToString();
}
break;
case "檢查過B、C型肝炎":
string checkBCTypeHepatitisId= sec.Entry[0].Reference.ToString();
Observation checkBC = client.Read<Observation>(checkBCTypeHepatitisId);
if (resultUploadDate == string.Empty)
{
resultUploadDate = logic.AdToRocEra(checkBC.Issued.ToString());
}
if (checkBC.Value is FhirString checkBCTypeHepatitisValue)
{
checkBCTypeHepatitis = checkBCTypeHepatitisValue.ToString();
}
break;
case "血壓檢查結果與建議":
string bloodPressureResultAndRecommendationId = sec.Entry[0].Reference.ToString();
DiagnosticReport bloodPressureReport = client.Read<DiagnosticReport>(bloodPressureResultAndRecommendationId);
bloodPressureResultAndRecommendation = bloodPressureReport.Conclusion;
break;
case "血糖檢查結果判讀":
string bloodSugarResultInterpretationId = sec.Entry[0].Reference.ToString();
DiagnosticReport bloodSugarReport = client.Read<DiagnosticReport>(bloodSugarResultInterpretationId);
bloodSugarResultInterpretation = bloodSugarReport.Conclusion;
break;
case "血脂肪檢查結果判讀":
string lipidProfileResultInterpretationId = sec.Entry[0].Reference.ToString();
DiagnosticReport lipidProfileReport = client.Read<DiagnosticReport>(lipidProfileResultInterpretationId);
lipidProfileResultInterpretation = lipidProfileReport.Conclusion;
break;
case "腎功能檢查結果判讀":
string kidneyFunctionResultInterpretationId = sec.Entry[0].Reference.ToString();
DiagnosticReport kidneyFunctionReport = client.Read<DiagnosticReport>(kidneyFunctionResultInterpretationId);
kidneyFunctionResultInterpretation = kidneyFunctionReport.Conclusion;
break;
case "肝功能檢查結果判讀":
string liverFunctionResultInterpretationId = sec.Entry[0].Reference.ToString();
DiagnosticReport liverFunctionReport = client.Read<DiagnosticReport>(liverFunctionResultInterpretationId);
liverFunctionResultInterpretation = liverFunctionReport.Conclusion;
break;
case "代謝症候群檢查結果與建議":
string metabolicSyndromeResultAndRecommendationId = sec.Entry[0].Reference.ToString();
DiagnosticReport metabolicSyndromeReport = client.Read<DiagnosticReport>(metabolicSyndromeResultAndRecommendationId);
metabolicSyndromeResultAndRecommendation = metabolicSyndromeReport.Conclusion;
break;
case "B型肝炎檢查結果與建議":
string hepatitisBResultAndRecommendationId = sec.Entry[0].Reference.ToString();
DiagnosticReport hepatitisBResult = client.Read<DiagnosticReport>(hepatitisBResultAndRecommendationId);
hepatitisBResultAndRecommendation = hepatitisBResult.Conclusion;
break;
case "C型肝炎檢查結果與建議":
string hepatitisCResultAndRecommendationId = sec.Entry[0].Reference.ToString();
DiagnosticReport hepatitisCResult = client.Read<DiagnosticReport>(hepatitisCResultAndRecommendationId);
hepatitisCResultAndRecommendation = hepatitisCResult.Conclusion;
break;
case "憂鬱檢測結果與建議":
string depressionDetectionResultAndRecommendationId = sec.Entry[0].Reference.ToString();
DiagnosticReport depressionDetectionReport = client.Read<DiagnosticReport>(depressionDetectionResultAndRecommendationId);
depressionDetectionResultAndRecommendation = depressionDetectionReport.Conclusion;
break;
}
threeHigh = (highBloodPressure == "1" || hyperlipidemia == "1" || hyperglycemiaTemp == "1") ? "1" : "0"; //三高: 高血壓、高血糖或高血脂
}
addExcel(worksheet, index, name, id, checkNoticeSerialNumber, medicalRecordNumber,
birthDate, gender, phone, medicalInstitutionCode, firstCheckDate, secondCheckDate,
entrustedAgentMedicalInstitutionCode, registeredResidence, resultUploadDate,
checkBCTypeHepatitis, hypertensionHistory, diabetesHistory, hyperlipidemiaHistory,
heartDisease, stroke, kidneyDisease, height, weight, systolicPressure, diastolicPressure,
highBloodPressure, threeHigh, waistCircumference, BMI, smoking, alcoholConsumption,
betelNutChewing, exercise, smokingCessationConsultation, alcoholReductionConsultation,
betelNutCessationConsultation, regularExerciseConsultation, maintainNormalWeightConsultation,
healthyDietConsultation, accidentInjuryPreventionConsultation, oralHealthCareConsultation,
hepatitisBSurfaceAntigen, hepatitisCAntibody, lowMood, lossOfInterest, urineAcidityValue,
urineProtein, urineSugar, urineSedimentMicroscopy, occultBlood, urineRedBloodCells,
urineWhiteBloodCells, urineEpithelialCells, cast, bacteria, appearance, hyperlipidemia,
cholesterol, triglycerides, fastingBloodSugar, creatinine, GOT, GPT,
highDensityLipoproteinCholesterol, lowDensityLipoproteinCholesterol, glomerularFiltrationRate,
bbody, cbody, liverFunctionResultInterpretation, bloodSugarResultInterpretation,
lipidProfileResultInterpretation, kidneyFunctionResultInterpretation,
bloodPressureResultAndRecommendation, metabolicSyndromeResultAndRecommendation,
hepatitisBResultAndRecommendation, hepatitisCResultAndRecommendation,
depressionDetectionResultAndRecommendation, com_id);
//addExcel_new(worksheet, index, name, id, checkNoticeSerialNumber, medicalRecordNumber,
// birthDate, gender, phone, medicalInstitutionCode, firstCheckDate, secondCheckDate,
// entrustedAgentMedicalInstitutionCode, registeredResidence, resultUploadDate,
// checkBCTypeHepatitis, hypertensionHistory, diabetesHistory, hyperlipidemiaHistory,
// heartDisease, stroke, kidneyDisease, height, weight, systolicPressure, diastolicPressure,
// highBloodPressure, threeHigh, waistCircumference, BMI, smoking, alcoholConsumption,
// betelNutChewing, exercise, smokingCessationConsultation, alcoholReductionConsultation,
// betelNutCessationConsultation, regularExerciseConsultation, maintainNormalWeightConsultation,
// healthyDietConsultation, accidentInjuryPreventionConsultation, oralHealthCareConsultation,
// hepatitisBSurfaceAntigen, hepatitisCAntibody, lowMood, lossOfInterest, urineAcidityValue,
// urineProtein, urineSugar, urineSedimentMicroscopy, occultBlood, urineRedBloodCells,
// urineWhiteBloodCells, urineEpithelialCells, cast, bacteria, appearance, hyperlipidemia,
// cholesterol, triglycerides, fastingBloodSugar, creatinine, GOT, GPT,
// highDensityLipoproteinCholesterol, lowDensityLipoproteinCholesterol, glomerularFiltrationRate,
// bbody, cbody, liverFunctionResultInterpretation, bloodSugarResultInterpretation,
// lipidProfileResultInterpretation, kidneyFunctionResultInterpretation,
// bloodPressureResultAndRecommendation, metabolicSyndromeResultAndRecommendation,
// hepatitisBResultAndRecommendation, hepatitisCResultAndRecommendation,
// depressionDetectionResultAndRecommendation, com_id,
// checkBCTypeHepatitis_isRed, hypertensionHistory_isRed, diabetesHistory_isRed,
// hyperlipidemiaHistory_isRed, heartDisease_isRed, stroke_isRed, kidneyDisease_isRed,
// height_isRed, weight_isRed, systolicPressure_isRed, diastolicPressure_isRed,
// highBloodPressure_isRed, threeHigh_isRed, waistCircumference_isRed, BMI_isRed,
// smoking_isRed, alcoholConsumption_isRed, betelNutChewing_isRed, exercise_isRed,
// smokingCessationConsultation_isRed, alcoholReductionConsultation_isRed,
// betelNutCessationConsultation_isRed, regularExerciseConsultation_isRed,
// maintainNormalWeightConsultation_isRed, healthyDietConsultation_isRed,
// accidentInjuryPreventionConsultation_isRed, oralHealthCareConsultation_isRed,
// hepatitisBSurfaceAntigen_isRed, hepatitisCAntibody_isRed, lowMood_isRed, lossOfInterest_isRed,
// urineAcidityValue_isRed, urineProtein_isRed, urineSugar_isRed, urineSedimentMicroscopy_isRed,
// occultBlood_isRed, urineRedBloodCells_isRed, urineWhiteBloodCells_isRed,
// urineEpithelialCells_isRed, cast_isRed, bacteria_isRed, appearance_isRed, hyperlipidemia_isRed,
// cholesterol_isRed, triglycerides_isRed, fastingBloodSugar_isRed, creatinine_isRed,
// GOT_isRed, GPT_isRed, highDensityLipoproteinCholesterol_isRed,
// lowDensityLipoproteinCholesterol_isRed, glomerularFiltrationRate_isRed, bbody_isRed,
// cbody_isRed, liverFunctionResultInterpretation_isRed, bloodSugarResultInterpretation_isRed,
// lipidProfileResultInterpretation_isRed, kidneyFunctionResultInterpretation_isRed,
// bloodPressureResultAndRecommendation_isRed, metabolicSyndromeResultAndRecommendation_isRed,
// hepatitisBResultAndRecommendation_isRed, hepatitisCResultAndRecommendation_isRed,
// depressionDetectionResultAndRecommendation_isRed);
Console.WriteLine(index + "_" + com_id + "Finish!");
}
public static ExcelWorksheet addExcel(ExcelWorksheet worksheet, int index,
string name, string id, string checkNoticeSerialNumber,
string medicalRecordNumber, string birthDate, string gender, string phone,
string medicalInstitutionCode, string firstCheckDate, string secondCheckDate,
string entrustedAgentMedicalInstitutionCode, string registeredResidence,
string resultUploadDate, string checkBCTypeHepatitis, string hypertensionHistory,
string diabetesHistory, string hyperlipidemiaHistory, string heartDisease, string stroke,
string kidneyDisease, string height, string weight, string systolicPressure,
string diastolicPressure, string highBloodPressure, string threeHigh, string waistCircumference,
string BMI, string smoking, string alcoholConsumption, string betelNutChewing,
string exercise, string smokingCessationConsultation, string alcoholReductionConsultation,
string betelNutCessationConsultation, string regularExerciseConsultation,
string maintainNormalWeightConsultation, string healthyDietConsultation,
string accidentInjuryPreventionConsultation, string oralHealthCareConsultation,
string hepatitisBSurfaceAntigen, string hepatitisCAntibody, string lowMood,
string lossOfInterest, string urineAcidityValue, string urineProtein, string urineSugar,
string urineSedimentMicroscopy, string occultBlood, string urineRedBloodCells,
string urineWhiteBloodCells, string urineEpithelialCells, string cast, string bacteria,
string appearance, string hyperlipidemia, string cholesterol, string triglycerides,
string fastingBloodSugar, string creatinine, string GOT, string GPT,
string highDensityLipoproteinCholesterol, string lowDensityLipoproteinCholesterol,
string glomerularFiltrationRate, string bbody, string cbody, string liverFunctionResultInterpretation,
string bloodSugarResultInterpretation, string lipidProfileResultInterpretation,
string kidneyFunctionResultInterpretation, string bloodPressureResultAndRecommendation,
string metabolicSyndromeResultAndRecommendation, string hepatitisBResultAndRecommendation,
string hepatitisCResultAndRecommendation, string depressionDetectionResultAndRecommendation, string com_id)
{
worksheet.Cells[index, 1].Value = name;
worksheet.Cells[index, 2].Value = id;
worksheet.Cells[index, 3].Value = checkNoticeSerialNumber; //檢查通知單序號
worksheet.Cells[index, 4].Value = medicalRecordNumber; //病歷號
worksheet.Cells[index, 5].Value = birthDate;
worksheet.Cells[index, 6].Value = gender;
worksheet.Cells[index, 7].Value = phone;
worksheet.Cells[index, 8].Value = medicalInstitutionCode; //醫事機構代號
worksheet.Cells[index, 9].Value = firstCheckDate;
worksheet.Cells[index, 10].Value = secondCheckDate;
worksheet.Cells[index, 11].Value = entrustedAgentMedicalInstitutionCode; //委託代檢醫事機構代號
worksheet.Cells[index, 12].Value = registeredResidence; //戶籍地
worksheet.Cells[index, 13].Value = resultUploadDate;
worksheet.Cells[index, 14].Value = checkBCTypeHepatitis;
worksheet.Cells[index, 15].Value = hypertensionHistory;
worksheet.Cells[index, 16].Value = diabetesHistory;
worksheet.Cells[index, 17].Value = hyperlipidemiaHistory;
worksheet.Cells[index, 18].Value = heartDisease;
worksheet.Cells[index, 19].Value = stroke;
worksheet.Cells[index, 20].Value = kidneyDisease;
worksheet.Cells[index, 21].Value = height;
worksheet.Cells[index, 22].Value = weight;
worksheet.Cells[index, 23].Value = systolicPressure;
worksheet.Cells[index, 24].Value = diastolicPressure;
worksheet.Cells[index, 25].Value = highBloodPressure;
worksheet.Cells[index, 26].Value = threeHigh;
worksheet.Cells[index, 27].Value = waistCircumference;
worksheet.Cells[index, 28].Value = BMI;
worksheet.Cells[index, 29].Value = smoking;
worksheet.Cells[index, 30].Value = alcoholConsumption;
worksheet.Cells[index, 31].Value = betelNutChewing;
worksheet.Cells[index, 32].Value = exercise;
worksheet.Cells[index, 33].Value = smokingCessationConsultation;
worksheet.Cells[index, 34].Value = alcoholReductionConsultation;
worksheet.Cells[index, 35].Value = betelNutCessationConsultation;
worksheet.Cells[index, 36].Value = regularExerciseConsultation;
worksheet.Cells[index, 37].Value = maintainNormalWeightConsultation;
worksheet.Cells[index, 38].Value = healthyDietConsultation;
worksheet.Cells[index, 39].Value = accidentInjuryPreventionConsultation;
worksheet.Cells[index, 40].Value = oralHealthCareConsultation;
worksheet.Cells[index, 41].Value = hepatitisBSurfaceAntigen;
worksheet.Cells[index, 42].Value = hepatitisCAntibody;
worksheet.Cells[index, 43].Value = lowMood;
worksheet.Cells[index, 44].Value = lossOfInterest;
worksheet.Cells[index, 45].Value = urineAcidityValue;
worksheet.Cells[index, 46].Value = urineProtein;
worksheet.Cells[index, 47].Value = urineSugar;
worksheet.Cells[index, 48].Value = urineSedimentMicroscopy;
worksheet.Cells[index, 49].Value = occultBlood;
worksheet.Cells[index, 50].Value = urineRedBloodCells;
worksheet.Cells[index, 51].Value = urineWhiteBloodCells;
worksheet.Cells[index, 52].Value = urineEpithelialCells;
worksheet.Cells[index, 53].Value = cast;
worksheet.Cells[index, 54].Value = bacteria;
worksheet.Cells[index, 55].Value = appearance;
worksheet.Cells[index, 56].Value = hyperlipidemia;
worksheet.Cells[index, 57].Value = cholesterol;
worksheet.Cells[index, 58].Value = triglycerides;
worksheet.Cells[index, 59].Value = fastingBloodSugar;
worksheet.Cells[index, 60].Value = creatinine;
worksheet.Cells[index, 61].Value = GOT;
worksheet.Cells[index, 62].Value = GPT;
worksheet.Cells[index, 63].Value = highDensityLipoproteinCholesterol;
worksheet.Cells[index, 64].Value = lowDensityLipoproteinCholesterol;
worksheet.Cells[index, 65].Value = glomerularFiltrationRate;
worksheet.Cells[index, 66].Value = bbody;
worksheet.Cells[index, 67].Value = cbody;
worksheet.Cells[index, 68].Value = liverFunctionResultInterpretation;
worksheet.Cells[index, 69].Value = bloodSugarResultInterpretation;
worksheet.Cells[index, 70].Value = lipidProfileResultInterpretation;
worksheet.Cells[index, 71].Value = kidneyFunctionResultInterpretation;
worksheet.Cells[index, 72].Value = bloodPressureResultAndRecommendation;
worksheet.Cells[index, 73].Value = metabolicSyndromeResultAndRecommendation;
worksheet.Cells[index, 74].Value = hepatitisBResultAndRecommendation; //B型肝炎檢查結果與建
worksheet.Cells[index, 75].Value = hepatitisCResultAndRecommendation; //C型肝炎檢查結果與建
worksheet.Cells[index, 76].Value = depressionDetectionResultAndRecommendation;
worksheet.Cells[index, 77].Value = com_id;
return worksheet;
}
//public static ExcelWorksheet addExcel_new(ExcelWorksheet worksheet, int index,
// string name, string id, string checkNoticeSerialNumber,
// string medicalRecordNumber, string birthDate, string gender, string phone,
// string medicalInstitutionCode, string firstCheckDate, string secondCheckDate,
// string entrustedAgentMedicalInstitutionCode, string registeredResidence,
// string resultUploadDate, string checkBCTypeHepatitis, string hypertensionHistory,
// string diabetesHistory, string hyperlipidemiaHistory, string heartDisease, string stroke,
// string kidneyDisease, string height, string weight, string systolicPressure,
// string diastolicPressure, string highBloodPressure, string threeHigh, string waistCircumference,
// string BMI, string smoking, string alcoholConsumption, string betelNutChewing,
// string exercise, string smokingCessationConsultation, string alcoholReductionConsultation,
// string betelNutCessationConsultation, string regularExerciseConsultation,
// string maintainNormalWeightConsultation, string healthyDietConsultation,
// string accidentInjuryPreventionConsultation, string oralHealthCareConsultation,
// string hepatitisBSurfaceAntigen, string hepatitisCAntibody, string lowMood,
// string lossOfInterest, string urineAcidityValue, string urineProtein, string urineSugar,
// string urineSedimentMicroscopy, string occultBlood, string urineRedBloodCells,
// string urineWhiteBloodCells, string urineEpithelialCells, string cast, string bacteria,
// string appearance, string hyperlipidemia, string cholesterol, string triglycerides,
// string fastingBloodSugar, string creatinine, string GOT, string GPT,
// string highDensityLipoproteinCholesterol, string lowDensityLipoproteinCholesterol,
// string glomerularFiltrationRate, string bbody, string cbody, string liverFunctionResultInterpretation,
// string bloodSugarResultInterpretation, string lipidProfileResultInterpretation,
// string kidneyFunctionResultInterpretation, string bloodPressureResultAndRecommendation,
// string metabolicSyndromeResultAndRecommendation, string hepatitisBResultAndRecommendation,
// string hepatitisCResultAndRecommendation, string depressionDetectionResultAndRecommendation, string com_id,
// bool checkBCTypeHepatitis_isRed, bool hypertensionHistory_isRed, bool diabetesHistory_isRed,
// bool hyperlipidemiaHistory_isRed, bool heartDisease_isRed, bool stroke_isRed,
// bool kidneyDisease_isRed, bool height_isRed, bool weight_isRed, bool systolicPressure_isRed,
// bool diastolicPressure_isRed, bool highBloodPressure_isRed, bool threeHigh_isRed,
// bool waistCircumference_isRed, bool BMI_isRed, bool smoking_isRed, bool alcoholConsumption_isRed,
// bool betelNutChewing_isRed, bool exercise_isRed, bool smokingCessationConsultation_isRed,
// bool alcoholReductionConsultation_isRed, bool betelNutCessationConsultation_isRed,
// bool regularExerciseConsultation_isRed, bool maintainNormalWeightConsultation_isRed,
// bool healthyDietConsultation_isRed, bool accidentInjuryPreventionConsultation_isRed,
// bool oralHealthCareConsultation_isRed, bool hepatitisBSurfaceAntigen_isRed,
// bool hepatitisCAntibody_isRed, bool lowMood_isRed, bool lossOfInterest_isRed,
// bool urineAcidityValue_isRed, bool urineProtein_isRed, bool urineSugar_isRed,
// bool urineSedimentMicroscopy_isRed, bool occultBlood_isRed, bool urineRedBloodCells_isRed,
// bool urineWhiteBloodCells_isRed, bool urineEpithelialCells_isRed, bool cast_isRed, bool bacteria_isRed,
// bool appearance_isRed, bool hyperlipidemia_isRed, bool cholesterol_isRed, bool triglycerides_isRed,
// bool fastingBloodSugar_isRed, bool creatinine_isRed, bool GOT_isRed, bool GPT_isRed,
// bool highDensityLipoproteinCholesterol_isRed, bool lowDensityLipoproteinCholesterol_isRed,
// bool glomerularFiltrationRate_isRed, bool bbody_isRed, bool cbody_isRed,
// bool liverFunctionResultInterpretation_isRed, bool bloodSugarResultInterpretation_isRed,
// bool lipidProfileResultInterpretation_isRed, bool kidneyFunctionResultInterpretation_isRed,
// bool bloodPressureResultAndRecommendation_isRed, bool metabolicSyndromeResultAndRecommendation_isRed,
// bool hepatitisBResultAndRecommendation_isRed, bool hepatitisCResultAndRecommendation_isRed,
// bool depressionDetectionResultAndRecommendation_isRed)
//{
// return null;
//}
}
}