Skip to content

Commit

Permalink
bring dev changes into main for release 24.07.01 (#68)
Browse files Browse the repository at this point in the history
* Migration update (#65)

* WIP: starting migration work

* WIP: run_migration CLI

* Moving the migration into separate module

* WIP: migration class

* WIP: separating migratory functionality

* WIP: fixing naming

* Refactoring and adding mock tests

* Modifying tests

* WIP: fixing tests

* WIP: fixing tests

* WIP: tests

* WIP: fixing tests

* WIP: fixing test

* Fixing tests

* WIP: fixing tests

* WIP: fixing errors

* Fixing formatting

* Addressing comments

* Tests

* WIP: fixing tests

* WIP: fixing test

* Fixing tests

* WIP: working single tree

* Changed the migration from referencing the latest applied to the latest created file
(Reversable)

* Only allow migreation to be generated, if the system is caught up

* WIP: adding testing

* Removing tests

* Adding back the test case

* Fixing upgrade

* Fixing a test

* Changed to linked list

* WIP: adding test

* WIP: testing

* WIP: testing

* WIP: testing

* Fixing cycles

* WIP: adding eq

* Fixing cycles

* WIP: fixing cycles

* WIP: fixing migration

* WIP: fixing

* WIP: fixing migration

* WIP: fixing migration

* Testing cycle

* errors

* Fixing errors

* errors

* errors

* Refactoring Linked List utilities

* WIP: fixing cycles

* WIP: fixing cycles

* Fixing cycles

* Fixing data

* WIP:fix

* Testing

* WIP: fixing errors

* WIP: new

* WIP: fixing errors

* WIP: fixing cycle

* WIP: fixing errors

* Fixing errors

* WIP: fixing erros

* WIp: fixing

* fixing

* fixing circular

* Adding tests

* Changing logic

* utils

* fix list fixture

* fix

* Fixing test

* Responding to comments

* Fixing add

* Adding comments

* Fixing tests

* Fixing tests

* Tests

* Tests

* Fixed Test

* migration

* Fixing tests

* WIP: test

* WIP: file

* Fixing test

* WIP: fixing

* WIP: imp

* WIP: imp

* Removing .imp test

* WIP: removing test

* Adding property

* Decoupling name from version

* Enforce unique  migration names

* Fixing test

* Adding errors

* Testing added

* Fixing tests

* Errors

* New version

* Adding tests

* Fixing

* Adding tests

* Tests

* Modifying tests

* test

* Fixing tests

* Added example

* Small adjusments to the text

* Addressing comments
WIP: put

* Constant system comparison

* Adding temporary function to test direct PUT that is failing from within
the code.

* Left an exception where the implementation doesn't match the spec

* Ported away from HAPI_request, preferring requests on this module.
Eliminated a number of repeated strings using common variables
Use logging rather than print
When including query string parameters, use built in function
parameters, as special characters need to be URL encoded.

* Fixing

* Removing test

* Made migrations more robust

* Removing isacc

* Changing default number to uuid

---------

Co-authored-by: Paul F Bugni <[email protected]>

* Migration moving (#67)

Changing the isacc to reference the package instead. Requirements.txt will work when we update the fhir-migration package at main

---------

Co-authored-by: Daniil <[email protected]>
  • Loading branch information
pbugni and Filienko authored Jul 1, 2024
1 parent 9edc802 commit bdc6a8e
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 6 deletions.
5 changes: 2 additions & 3 deletions isacc_messaging/api/isacc_record_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def dispatch_cr(self, cr: CommunicationRequest):
if not patient.generalPractitioner:
practitioner=None
else:

practitioner = resolve_reference(patient.generalPractitioner[0].reference)
expanded_payload = expand_template_args(
content=cr.payload[0].contentString,
Expand Down Expand Up @@ -418,6 +417,6 @@ def execute_requests(self) -> Tuple[List[dict], List[dict]]:

return successes, errors

def process_cr(self, cr: CommunicationRequest, successes: list):
def process_cr(self, cr: CommunicationRequest):
status, statusReason = self.dispatch_cr(cr=cr)
return status, statusReason
return status, statusReason
2 changes: 1 addition & 1 deletion isacc_messaging/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

base_blueprint = Blueprint('base', __name__, cli_group=None)


@base_blueprint.route('/')
def root():
return {'ok': True}
Expand Down Expand Up @@ -302,3 +301,4 @@ def deactivate_patient(patient_id):
f"Patient {patient_id} active set to false",
level='info'
)

3 changes: 2 additions & 1 deletion isacc_messaging/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import os
from werkzeug.middleware.proxy_fix import ProxyFix

from fhir_migrations import commands as migration_commands
from isacc_messaging.api import views
from isacc_messaging.audit import audit_entry, audit_log_init
from isacc_messaging.extensions import oauth


def create_app(testing=False, cli=False):
"""Application factory, used to create application
"""
Expand Down Expand Up @@ -58,6 +58,7 @@ def register_blueprints(app):
"""register all blueprints for application
"""
app.register_blueprint(views.base_blueprint)
app.register_blueprint(migration_commands.migration_blueprint)


def configure_proxy(app):
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ torch==1.13.0
transformers==4.24.0
scipy==1.7.3
numpy==1.21.5
pandas==1.3.5
pandas==1.3.5
git+https://github.com/uwcirg/fhir-migrations
27 changes: 27 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import unittest
from isacc_messaging.app import create_app

class TestConfig:
TESTING = True
LOG_LEVEL = 'DEBUG'
LOGSERVER_URL = None
LOGSERVER_TOKEN = None
VERSION_STRING = 'test_version'
PREFERRED_URL_SCHEME = 'http'


class TestIsaccMessagingApp(unittest.TestCase):
def setUp(self):
self.app = create_app(testing=True)
self.app.config.from_object(TestConfig)
self.client = self.app.test_client()

def test_app_exists(self):
self.assertIsNotNone(self.app)

def test_blueprints_registered(self):
self.assertIn('base', self.app.blueprints)
self.assertIn('migration', self.app.blueprints)

if __name__ == '__main__':
unittest.main()

0 comments on commit bdc6a8e

Please sign in to comment.