forked from eth-mds/ricu
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sic bugfixes #10
Merged
Merged
Sic bugfixes #10
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
0d7e464
define SIC data structure
prockenschaub 9ffcb4d
add SIC to auto attach
prockenschaub 2884e3f
add SIC loading helpers
prockenschaub 2b39787
add callback hooks to postprocess tbls on import
prockenschaub d459959
add callback to deserialise sicdb data_float_h
prockenschaub 32b8f60
add missing tbl_callback function
prockenschaub 6afe44c
add sic_itm inspired by hrd_itm
prockenschaub bc41f88
adjust data_float_h config to recent changes
prockenschaub b53c592
add hr and crea as examples for sicdb
prockenschaub 3ca5b04
add sex and death concepts for sic
prockenschaub 9396da5
add vitals, labs, height, and weight concepts for sic
prockenschaub e84ea7d
add age and los_icu concepts
prockenschaub b9350a1
add most medication concepts for sic
prockenschaub 5419ab4
fix preproc for data_float_h
prockenschaub 078149e
add OMR to miiv
dplecko e5be7e8
add miiv omr
dplecko c8d0c9b
load_concepts() concepts arg doc fix
dplecko b1e2aed
load_concepts.integer() src NULL fix
dplecko 9c3481f
Fix sic config
manuelburger d5d4c07
Properly support full rawdata found in sic
manuelburger 31d48f7
Remove print
manuelburger eb41aaa
Add utility functions proposed by `prockenschaub` here: https://githu…
manuelburger 3621a42
Merge branch 'sicdb' of github.com:prockenschaub/ricu-package into si…
manuelburger e4c930a
Fix configs for `sic` based on `prockenschaub`
manuelburger 6ef9b50
Merge branch 'main' of github.com:ratschlab/ricu into sic-bugfixes
manuelburger ee48363
Fix `sic` configs based on https://github.com/prockenschaub/ricu-pack…
manuelburger c2b8c49
Remove prints and use ricu msg
manuelburger e5061d4
Remove redundant `report_probolems`
manuelburger 2c8d763
Add prints and tempdir arg
manuelburger 71672bf
Merge branch 'sic-bugfixes' of github.com:ratschlab/ricu into sic-bug…
manuelburger 14a1403
Cleanup prints
manuelburger d96d9fe
Fix blood_gas config
manuelburger fa37f63
Fix sic table config
manuelburger 9f152c3
Use finer resolution rawdata where available
manuelburger 74a66d9
Pass tbl callback correctly
manuelburger 84ec51f
Fix missing callback application
manuelburger 99529cd
Apply callback before split_write
manuelburger f54afad
Config updates:
manuelburger ad6b07e
Fix configs
manuelburger 640d4d2
Fix callback
manuelburger 9ebaf7f
Use `apply_map` for `sic` `sex`
manuelburger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
sic_data_float_h <- function(dat, ...) { | ||
|
||
hexstring_to_float <- function(x) { | ||
if (is.na(x)) { | ||
return(NA_real_) | ||
} | ||
hexstring <- substring(x, seq(1, 482, 2), seq(2, 482, 2)) | ||
bytes <- as.raw(strtoi(hexstring[-1], base = 16)) | ||
floats <- readBin(bytes, numeric(), length(bytes) %/% 4, 4, endian = "little") | ||
ifelse(floats == 0, NA_real_, floats) | ||
} | ||
|
||
setDT(dat) | ||
|
||
# TODO: remove hard coding of rawdata and derive from JSON config | ||
dat[, c("rawdata") := lapply(get("rawdata"), hexstring_to_float)] | ||
dat <- dat[, .( | ||
Offset = Offset + 60 * (0:(sapply(rawdata, length)-1)), | ||
Val = Val, | ||
cnt = cnt, | ||
rawdata = unlist(rawdata), | ||
rawdata_present = !is.na(rawdata) | ||
), | ||
by = .(id, CaseID, DataID) | ||
] | ||
|
||
# Fix measurements that only have one value | ||
dat[rawdata_present == FALSE, rawdata := Val] | ||
dat[, rawdata_present := NULL] | ||
|
||
return(dat) | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this different from
apply_map(
735="Female",
735="Male"))
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jup, definitely the same and simpler. That came from merging PR code from
eth-mds
. Fixed it.