-
Notifications
You must be signed in to change notification settings - Fork 0
/
certification-v1.1.smcl
144 lines (139 loc) · 6.31 KB
/
certification-v1.1.smcl
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
{smcl}
{com}{sf}{ul off}{txt}{.-}
name: {res}Certification
{txt}log: {res}/Users/razvanazamfirei/Git/stata-commands/prism-score/certification.smcl
{txt}log type: {res}smcl
{txt}opened on: {res}28 Nov 2022, 17:36:30
{com}. do "/Users/razvanazamfirei/Git/stata-commands/prism-score/tests/certification_script.do"
{txt}
{com}. cscript prismscore adofile prismscore
{txt}{hline 63}BEGIN prismscore
-> which prismscore, usesysdir
/Users/razvanazamfirei/Library/Application Support/Stata/ado/plus/p/prismscore.ado
{res}*! | Version: 1.1 | Last Updated: Nov 28, 2022
{txt}
{com}. cd "./tests/data"
{res}/Users/razvanazamfirei/Git/stata-commands/prism-score/tests/data
{txt}
{com}. use "prism_3_dataset_5.dta"
{txt}
{com}. datasignature confirm using "prism_3_dataset_5.dtasig", strict
{res}{txt}{p 2 3 2}
(data unchanged since 21nov2022 18:59{txt})
{p_end}
{com}.
. qui prismscore neuro_c nonneuro_c totalscore_c, age(age) sbp(sbp) hr(hr) temp(temp_high) templow(temp_low) gcs(gcs) pupils(pupils) ph(phlow) phhigh(phhigh) bicarb(bicarblow) bicarbhigh(bicarbhigh) pco2(pco2) pao2(pao2) glucose(glucose) potassium(potassium) creatinine(creatinine) bun(bun) wbc(wbc) plt(plt) pt(pt) ptt(ptt)
{txt}
{com}.
. assert neuro_c == neuro
{txt}
{com}. assert nonneuro_c == nonneuro
{txt}
{com}. assert totalscore_c == totalscore
{txt}
{com}.
. drop neuro_c nonneuro_c totalscore_c
{txt}
{com}.
. qui prismscore neuro_c nonneuro_c totalscore_c, doa(doa) dob(dob) sbp(sbp) hr(hr) temp(temp_high) templow(temp_low) gcs(gcs) pupils(pupils) ph(phlow) phhigh(phhigh) bicarb(bicarblow) bicarbhigh(bicarbhigh) pco2(pco2) pao2(pao2) glucose(glucose_si) potassium(potassium) creatinine(creatinine_si) bun(bun_si) wbc(wbc_k) plt(plt_k) pt(pt) ptt(ptt) pltunit(1000) wbcunit(1000) si
{txt}
{com}. assert neuro_c == neuro
{txt}
{com}. assert nonneuro_c == nonneuro
{txt}
{com}. assert totalscore_c == totalscore
{txt}
{com}. drop neuro_c nonneuro_c totalscore_c
{txt}
{com}.
. clear
{txt}
{com}.
. use "P4_Validated Data.dta"
{txt}
{com}. datasignature confirm using "P4_Validated Data.dtasig", strict
{res}{txt}{p 2 3 2}
(data unchanged since 22nov2022 11:38{txt})
{p_end}
{com}.
. qui prismscore neuro_c nonneuro_c totalscore_c score, age(age) sbp(sbp) hr(hr) temp(temp_high) templow(temp_low) gcs(gcs) pupils(pupils) ph(phlow) phhigh(phhigh) bicarb(bicarblow) bicarbhigh(bicarbhigh) pco2(pco2) pao2(pao2) glucose(glucose) potassium(potassium) creatinine(creatinine) bun(bun) wbc(wbc) plt(plt) pt(pt) ptt(ptt) prismiv source(source) risk(risk) cancer(cancer) cpr(cpr)
{txt}
{com}.
. assert abs(float(prism4) - float(score)) < 2 * 1E-2
{txt}
{com}. assert neuro_c == neuro
{txt}
{com}. assert nonneuro_c == nonneuro
{txt}
{com}. assert totalscore_c == totalscore
{txt}
{com}. drop score neuro_c nonneuro_c totalscore_c
{txt}
{com}.
. qui prismscore neuro_c nonneuro_c totalscore_c score, dob(dob) doa(doa) sbp(sbp) hr(hr) temp(temp_high) templow(temp_low) gcs(gcs) pupils(pupils) ph(phlow) phhigh(phhigh) bicarb(bicarblow) bicarbhigh(bicarbhigh) pco2(pco2) pao2(pao2) glucose(glucose_si) potassium(potassium) creatinine(creatinine_si) bun(bun_si) wbc(wbc_k) plt(plt_k) pt(pt) ptt(ptt) pltunit(1000) wbcunit(1000) si prismiv source(source) risk(risk) cancer(cancer) cpr(cpr)
{txt}
{com}. assert abs(float(prism4) - float(score)) < 2 * 1E-2
{txt}
{com}. assert neuro_c == neuro
{txt}
{com}. assert nonneuro_c == nonneuro
{txt}
{com}. assert totalscore_c == totalscore
{txt}
{com}. drop score neuro_c nonneuro_c totalscore_c
{txt}
{com}.
. noi di as result "The following section will intentionally trigger errors and verify the appropriate error code. This test is passed succesfully if the last line displays: Certification completed succesfully."
{res}The following section will intentionally trigger errors and verify the appropriate error code. This test is passed succesfully if the last line displays: Certification completed succesfully.
{txt}
{com}. qui {c -(}
{err}You must specify either 1 or 4 newvariable names if you are trying to calculate the PRISM IV score. See help prismscore for more details.
You must specify either 1 or 4 newvariable names if you are trying to calculate the PRISM IV score. See help prismscore for more details.
You must specify 3 newvarvarnames for PRISM III score calculations. See help prismscore for more details.
You must specify 3 newvarvarnames for PRISM III score calculations. See help prismscore for more details.
You have specified too many newvarnamesor have forgotten to include prismiv
not specified. See help prismscore for more details.
too few variables specified
not specified. See help prismscore for more details.
too few variables specified
not specified. See help prismscore for more details.
too few variables specified
not specified. See help prismscore for more details.
too few variables specified
Platelet Unit incorrectly specified.
WBC Unit incorrectly specified.
Both age, DoB and DoA are specified.
Specify either age or DoB and DoA
too many variables specified
Neither age, DoB or DoA are specified.
Specify either age or DoB and DoA
too few variables specified
You must specify both DoB and DoA
too few variables specified
You must specify both DoB and DoA
too few variables specified
Age is not in the correct format. See help prismscore for more details.
You must specify either PT or PTT. See help prismscore for more details.
too few variables specified
Pupils are not in the correct format. See help prismscore for more details.
source is not in the correct format. See help prismscore for more details.
cpr is not binary. See help prismscore for more details.
0/1 variable required
cancer is not binary. See help prismscore for more details.
0/1 variable required
risk is not binary. See help prismscore for more details.
0/1 variable required
{txt}
{com}. noi di as result "Certification completed succesfully. `c(current_date)' `c(current_time)'"
{res}Certification completed succesfully. 28 Nov 2022 17:36:54
{txt}
{com}.
{txt}end of do-file
{com}. log close Certification
{txt}name: {res}Certification
{txt}log: {res}/Users/razvanazamfirei/Git/stata-commands/prism-score/certification.smcl
{txt}log type: {res}smcl
{txt}closed on: {res}28 Nov 2022, 17:37:01
{txt}{.-}
{smcl}
{txt}{sf}{ul off}