Skip to content

Commit

Permalink
feat: add condition whether check the stored resource ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Oct 27, 2021
1 parent 2d8fc29 commit d21442a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion FHIR-mongoose-Models-Generator/resourceGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ function generateResourceSchema (type) {
let storedID = await mongodb.FHIRStoredID.findOne({
id: this.id
});
if (storedID) {
if (storedID && ENABLE_CHECK_ALL_RESOURCE_ID== "true") {
if (storedID.resourceType == "${type}") {
const docInHistory = await mongodb.${type}_history.findOne({
id: this.id
Expand Down
4 changes: 3 additions & 1 deletion build/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ FHIRSERVER_HOST="localhost"
FHIRSERVER_PORT=8080
FHIRSERVER_APIPATH="fhir"
ENABLE_TOKEN_AUTH=true
ENABLE_TOKEN_AUTH=false
JWT_SECRET_KEY="secret-key"
ADMIN_LOGIN_PATH="adminLogin"
ADMIN_USERNAME="admin"
ADMIN_PASSWORD="password"
ENABLE_CHECK_ALL_RESOURCE_ID=false
`;
fs.writeFileSync(".env" , envText);
console.log("Please config dotenv file first, the example dotenv file generated in root path");
Expand Down

0 comments on commit d21442a

Please sign in to comment.