This repository has been archived by the owner on Nov 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from PhysiciansDataCollaborative/dev
Added 3rd Next
- Loading branch information
Showing
5 changed files
with
126 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
# | ||
# Import 3rd Next | ||
# | ||
# | ||
# Exit on errors or uninitialized variables | ||
set -e -o nounset | ||
|
||
|
||
# Start in data folder | ||
# | ||
cd /data/3rdNext | ||
|
||
|
||
# Create a list of text files | ||
# | ||
FILES=$(find . -maxdepth 1 -type f -name "*.txt") | ||
|
||
|
||
# Import each text file and move it to archived | ||
# | ||
for f in ${FILES} | ||
do | ||
mongoimport --db query_composer_development --collection thirdnexts --type json --file ${f} | ||
done |
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,47 @@ | ||
/* | ||
* Filters out providers based on id's and the initiative they are in. | ||
* | ||
* @param providerId {string} - the provider identifier to filter against. | ||
* @param initiative {string} - the initiative identifier. One of: | ||
* - "PPh" : polypharmacy | ||
* | ||
* @returns - true if the provider is part of the specified initiative | ||
* false otherwise. | ||
*/ | ||
function filterProviders(providerId, initiative){ | ||
|
||
//check that we have valid inputs | ||
if ( !providerId || !initiative ) { | ||
|
||
return false; | ||
|
||
} | ||
|
||
var inits = { | ||
|
||
"PPh" : [ | ||
"cpsid", //currently contains some test values. | ||
"PROVIDER1", | ||
"PROVIDER2" | ||
] | ||
}; | ||
|
||
|
||
//check that the initiative is valid. | ||
if ( inits[initiative] === undefined ){ | ||
|
||
return false; | ||
|
||
} | ||
|
||
if( inits[initiative].indexOf(providerId) > -1 ){ | ||
|
||
return true; | ||
|
||
}else{ | ||
|
||
return false; | ||
|
||
} | ||
|
||
} |
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,43 @@ | ||
#!/bin/bash | ||
# | ||
# Halt on errors or uninitialized variables | ||
# | ||
set -e -o nounset | ||
|
||
|
||
# Expected input | ||
# | ||
# $0 this script | ||
# $1 Doctor (clinician) ID | ||
|
||
|
||
# Check parameters | ||
# | ||
if([ $# -lt 1 ]||[ $# -gt 1 ]) | ||
then | ||
echo | ||
echo "Unexpected number of parameters." | ||
echo | ||
echo "Usage: providers_add.sh [doctorID]" | ||
echo | ||
exit | ||
fi | ||
|
||
|
||
# Set variables from parameters | ||
# | ||
DOCTOR=${1} | ||
|
||
|
||
# Get script directory and target file | ||
# | ||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
TARGET=${DIR}/providers.txt | ||
|
||
|
||
# Add provider | ||
# | ||
if(! grep --quiet ${DOCTOR} ${TARGET} ) | ||
then | ||
echo ${DOCTOR} | sudo tee -a ${TARGET} | ||
fi |
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,4 @@ | ||
# List provider IDs here | ||
# | ||
cpsid | ||
91604 |