diff --git a/documentation/AnalyticsDocumentationEN.md b/documentation/AnalyticsDocumentationEN.md index ac5cb7e..e8032fd 100644 --- a/documentation/AnalyticsDocumentationEN.md +++ b/documentation/AnalyticsDocumentationEN.md @@ -1,15 +1,15 @@ -#Analytics documentation +# Analytics documentation MedCodeSearch sends analytics data to eonum in order to optimize the search algorithm. In this documentation is specified when MedCodeSearch sends this data and how. -###When does analytics data get sent? +### When does analytics data get sent? When the user clicks on a code in the search results list. No data is sent when the user clicks on a subordinate or superior code or on a code in the list of remembered codes. -###How does analytics data get sent? +### How does analytics data get sent? MedCodeSearch sends a http-request to eonum with the URL-Parameter: query=Input @@ -25,11 +25,11 @@ Where "Language" is the language of the catalogue of the code and "Input" ist der search term that was used. -###How is the analytics feature implemented? +### How is the analytics feature implemented? The function to send the analytics data is handled by two components: search-results.component.ts and catalog.service.ts When a code is clicked on the function openCode in the search-results component is activated. this calls the function sendAnalytics which calls the sendAnalytics function in the catalog.service. The catalog.service calls the function getSingleElementForTypeByCode which makes the actual http request. -It se important to know that the search-results component calls the sendAnalytics function of the catalog.service interface (that is i.catalog.service.ts). \ No newline at end of file +It se important to know that the search-results component calls the sendAnalytics function of the catalog.service interface (that is i.catalog.service.ts). diff --git a/documentation/AnalyticsDokumentationDE.md b/documentation/AnalyticsDokumentationDE.md index 5cf3203..254c34a 100644 --- a/documentation/AnalyticsDokumentationDE.md +++ b/documentation/AnalyticsDokumentationDE.md @@ -1,15 +1,15 @@ -#Analytics Dokumentation +# Analytics Dokumentation MedCodeSearch sendet Analytics Daten an eonum um den SuchAlgorithmus zu optimieren. In dieser Dokumentation wird spezifiziert wann diese Daten gesendet werden und wie. -###Wann werden Analytics Daten gesendet? +### Wann werden Analytics Daten gesendet? Wenn der Benutzer auf einen Code in der Resultatenliste klickt. Es werden kein Analytics Daten gesendet wenn der Benutzer einen unter- oder übergeordneten Code anklickt oder einen Code in der Liste der gemerkten Codes anklickt. -###Wie werden Analytics Daten gesendet? +### Wie werden Analytics Daten gesendet? MedCodeSearch sendet ein http-request an eonum mit dem URL-Parameter: query=Eingabe @@ -25,10 +25,10 @@ Wobei "Sprache" die Sprache des Katalogs des Codes ist und "Eingabe" ist der Suchbegriff der verwendet wurde. -###Wie ist das Analytics Feature implementiert? +### Wie ist das Analytics Feature implementiert? Die Funktion zum senden der Analytics Daten wird von zwei Komponenten gehandhabt. Die komponente search-results.component.ts und catalog.service.ts Wenn auf ein Code geklickt wird dann wird die Funktion openCode in der search-results Komponente aktiviert. Diese ruft die Funktion sendAnalytics auf welche dann die sendAnalytics funktion im catalog.service aufruft. Der catalog.service ruft dann getSingleElementForTypeByCode auf welche den tatsächlichen http aufruf handhabt. -Es ist wichtig zu wissen dass die search-results Komponente die sendAnalytics funktion des catalog.service interfaces aufruft (i.catalog.service.ts). \ No newline at end of file +Es ist wichtig zu wissen dass die search-results Komponente die sendAnalytics funktion des catalog.service interfaces aufruft (i.catalog.service.ts). diff --git a/documentation/CatalogArchitecture.md b/documentation/CatalogArchitecture.md index f265e4d..2d46752 100644 --- a/documentation/CatalogArchitecture.md +++ b/documentation/CatalogArchitecture.md @@ -1,6 +1,6 @@ # Architektur eonum search frontend -![](./CatalogArchitecture.png) +![](uml/class/CatalogArchitecture.png) Die MedCodeSearch Software erlaubt es, mehrere verschiedene Kataloge nach Elementen zu durchsuchen. In diesem Dokument is beschrieben, wie die Architektur dahinter aussieht. @@ -14,4 +14,4 @@ Zum Testen können beliebige Fake-Objekte, welche das `ICatalogService`-Interfac Die Klasse `CatalogElement` modelliert ein Objekt aus einem Katalog. `CatalogElement` enthält dabei alle Eigenschaften der Objekte, welche in allen Katalogen gleich sind. -Die Klasse `CatalogConfiguration` dient zur Initialisierung des `CatalogService` und beinhaltet Daten wie die Katalog-Suchadressen und die verfügbaren Versionen. \ No newline at end of file +Die Klasse `CatalogConfiguration` dient zur Initialisierung des `CatalogService` und beinhaltet Daten wie die Katalog-Suchadressen und die verfügbaren Versionen. diff --git a/documentation/HtmlArchitecture.md b/documentation/ComponentArchitecture.md similarity index 95% rename from documentation/HtmlArchitecture.md rename to documentation/ComponentArchitecture.md index c360ea1..4e16913 100644 --- a/documentation/HtmlArchitecture.md +++ b/documentation/ComponentArchitecture.md @@ -1,6 +1,6 @@ # Architektur Favorite System -![](./HtmlArchitecture.png) +![](uml/class/HtmlArchitecture.png) In diesem Dokument ist die Architektur der Angular-Komponenten dokumentiert. diff --git a/documentation/FavoriteArchitecture.md b/documentation/FavoriteArchitecture.md index d3b86ba..ee4ba71 100644 --- a/documentation/FavoriteArchitecture.md +++ b/documentation/FavoriteArchitecture.md @@ -1,6 +1,6 @@ # Architektur Favorite System -![](./FavoriteArchitecture.png) +![](uml/class/FavoriteArchitecture.png) Die MedCodeSearch Software unterstützt das Sichern von Favoriten, so dass der/die Benutzer/in einen bestimmten Code schnell wieder finden kann. In diesem Dokument ist die Architektur beschrieben. @@ -15,4 +15,4 @@ Das `IFavoritePersister` Interface erlaubt das freie Austauschen der Klassen `Se Das `FavoriteElementComponent` ist die Konsumenten-Klasse des Features und die Komponente, welche dem Benutzer entsprechende grafische Buttons und Elemente zur Verwendung der Favoriten-Funktion zur Verfügung stellt. -Das `FavoriteElement` selbst modelliert die Daten des Favorite-Code. \ No newline at end of file +Das `FavoriteElement` selbst modelliert die Daten des Favorite-Code. diff --git a/documentation/installation.md b/documentation/installation.md index b9a0833..ad7c5c8 100644 --- a/documentation/installation.md +++ b/documentation/installation.md @@ -29,7 +29,7 @@ In vielen Fällen kann diese Konfiguration in eine Datei namens .htaccess geschr } ---- + # Updaten der Versions @@ -47,7 +47,7 @@ ersetzt werden. Das Python script `generateVersions.py`, generiert dieses File bei Bedarf neu. ------ + # Build @@ -55,7 +55,7 @@ Das Python script `generateVersions.py`, generiert dieses File bei Bedarf neu. npm install && npm run-script build - Der Output befindet sich dann, mit neuen `versions.json` file, + Der Output befindet sich dann, mit neuen `assets/versions.json` file, im `dist` Ordner. diff --git a/documentation/routing.md b/documentation/routing.md new file mode 100644 index 0000000..a3f1612 --- /dev/null +++ b/documentation/routing.md @@ -0,0 +1,62 @@ +# Routing: Auflösung und Validierung der URL + +Die Componenten werden jeweils erst initialisiert, +nachdem die Route, zu der sie gehören, aufgelöst wurde. +D.h. DetailComponent wird z.B erst initialisiert, wenn das anzuzeigende +Element geladen ist. + +Folgendes Diagram veraunschaulicht in welcher Reihenfolge die Komponenten +initialisiert werden, und welche Route-Parameter und Daten sie beobachten. + +![](uml/sequence/page_load.png) + +## Katalog Validierung + +Auf den Routen `/:lang/:catalog` und `/:lang/:catalog/:version` wird der +**CatalogResolver** aktiviert um die Route aufzulösen. + +Dabei werden die Parameter validiert, und gegebenenfalls wird auf eine +gültige Version umgeleitet. + +Der **CatalogResolver** stellt zudem *displayInfos* für jeden Katalog +zusammen. + +Diese enthalten alle anzuzeigenden Versionen, verfügbaren +Versionen, sowie die ausgewählte Version bezüglich der Sprache, und der +**SearchFormComponent** verwendet diese um die Dropdowns zu füllen. + +![](uml/sequence/resolve_catalog.png) + +## Katalog Wechsel + +Wird ein Katalog oder Version ausgewählt, wird die Auswahl, bezüglich der +ausgewählten Sprache, direkt vom **SearchFormComponent** validiert. + +Ist die Auswahl nicht gültig, wird ein Popup angezeigt um die Sprache +zu wechseln . + +![](uml/sequence/change_catalog.png) + +## Katalog Element wechsel + +Auf der Route `:catalog/:version/:type/:code` wird der **CatalogElementResolver** +aktiviert, welcher entsprechend der Route, das Element für den +**DetailComponent** lädt. + +Entweder befindet sich das Element bereits im **CatalogElementCache**, +oder wird von der API geladen. + +Es werden zudem alle **Parent**-Elemente geladen, damit +direkt die Breadcrum angezeigt werden kann. + +![](uml/sequence/resolve_catalog_element.png) + +## Suche + +Beim Wechsel des QueryParameter *query*, startet der **SearchResultsComponent** +die Suche. + +Der **CatalogSearchService** ist so aufgebaut, dass immer +nur die neuste Suche gestartet wird, und veraltete ignoriert werden. + +![](uml/sequence/search.png) diff --git a/documentation/uml/change_catalog.png b/documentation/uml/change_catalog.png deleted file mode 100644 index 5cd412e..0000000 Binary files a/documentation/uml/change_catalog.png and /dev/null differ diff --git a/documentation/CatalogArchitecture.png b/documentation/uml/class/CatalogArchitecture.png similarity index 100% rename from documentation/CatalogArchitecture.png rename to documentation/uml/class/CatalogArchitecture.png diff --git a/documentation/CatalogArchitecture.xml b/documentation/uml/class/CatalogArchitecture.xml similarity index 100% rename from documentation/CatalogArchitecture.xml rename to documentation/uml/class/CatalogArchitecture.xml diff --git a/documentation/FavoriteArchitecture.png b/documentation/uml/class/FavoriteArchitecture.png similarity index 100% rename from documentation/FavoriteArchitecture.png rename to documentation/uml/class/FavoriteArchitecture.png diff --git a/documentation/FavoriteArchitecture.xml b/documentation/uml/class/FavoriteArchitecture.xml similarity index 100% rename from documentation/FavoriteArchitecture.xml rename to documentation/uml/class/FavoriteArchitecture.xml diff --git a/documentation/HtmlArchitecture.png b/documentation/uml/class/HtmlArchitecture.png similarity index 100% rename from documentation/HtmlArchitecture.png rename to documentation/uml/class/HtmlArchitecture.png diff --git a/documentation/HtmlArchitecture.xml b/documentation/uml/class/HtmlArchitecture.xml similarity index 100% rename from documentation/HtmlArchitecture.xml rename to documentation/uml/class/HtmlArchitecture.xml diff --git a/documentation/README.md b/documentation/uml/class/README.md similarity index 100% rename from documentation/README.md rename to documentation/uml/class/README.md diff --git a/documentation/WholeArchitecture.png b/documentation/uml/class/WholeArchitecture.png similarity index 100% rename from documentation/WholeArchitecture.png rename to documentation/uml/class/WholeArchitecture.png diff --git a/documentation/WholeArchitecture.xml b/documentation/uml/class/WholeArchitecture.xml similarity index 100% rename from documentation/WholeArchitecture.xml rename to documentation/uml/class/WholeArchitecture.xml diff --git a/documentation/uml/page_load.png b/documentation/uml/page_load.png deleted file mode 100644 index 51f2344..0000000 Binary files a/documentation/uml/page_load.png and /dev/null differ diff --git a/documentation/uml/page_load.puml b/documentation/uml/page_load.puml deleted file mode 100644 index cdea379..0000000 --- a/documentation/uml/page_load.puml +++ /dev/null @@ -1,136 +0,0 @@ - -@startuml -actor User -control Router <<@angular>> #orange - -entity LanguageGuard #lightgreen -entity TranslateService <> #orange -entity CatalogResolver #lightgreen -entity CatalogVersionService as VersionService #lightgreen -'database search.eonum <> #orange -participant AppComponent #lightblue -participant MainComponent #lightblue -participant SearchFormComponent #lightblue -participant SearchResultsComponent as ResultsComp #lightblue -entity CatalogSearchService as SearchService #lightgreen - -== Load Page, resolve and validate language, catalog and version (Without Hierarchy loading) == - -User -> Router: / -activate Router #orange - -activate VersionService #lightgreen -Router -> VersionService -VersionService -> VersionService: loadVersions() -note left #lightgrey - from 'assets/versions.json' -end note -VersionService --> Router -deactivate VersionService - -create AppComponent -Router ->> AppComponent: init -activate AppComponent #lightblue -AppComponent --> Router -deactivate AppComponent - -Router -> LanguageGuard: canActivate()? -activate LanguageGuard #lightgreen - -LanguageGuard ->> Router: navigate('de') -note right #lightgrey - get language from cookie,browser or default -end note -deactivate LanguageGuard - -Router -> LanguageGuard: canActivate('de)? - -activate LanguageGuard #lightgreen -LanguageGuard ->> TranslateService: setLanguage(de) -LanguageGuard --> Router: grant access -deactivate LanguageGuard - -Router -> Router: redirectTo('ICD') -Router ->> CatalogResolver: resolve('de', 'ICD') - -activate CatalogResolver #lightgreen -CatalogResolver -> CatalogResolver: getActiveVersion('de', 'ICD') -CatalogResolver ->> Router: navigate('ICD', '2016') -deactivate CatalogResolver - -Router ->> CatalogResolver: resolve('de', 'ICD', '2016') - -activate CatalogResolver #lightgreen -CatalogResolver -> VersionService: versionExists('de', 'ICD', '2016') -activate VersionService #lightgreen -VersionService -> CatalogResolver: true -deactivate VersionService - -note left #lightgrey - If catalog or version does not match, - redirect to index. -end note - -CatalogResolver -> CatalogResolver: activateVersion ('de', 'ICD', '2016') -CatalogResolver --> Router: displayInfos: CatalogDisplayInfos[] - - -deactivate CatalogResolver - -create MainComponent -Router -> MainComponent: init -activate MainComponent #lightblue - -MainComponent ->> Router: subscribeh to changes -Router ->> MainComponent: {params:{'de', 'ICD', '2016' }, queryParams{query}} - -create SearchFormComponent -MainComponent ->> SearchFormComponent: init -activate SearchFormComponent #lightblue - -SearchFormComponent -> Router: subscribe to changes -Router ->> SearchFormComponent: {data:{displayInfos},params:{'de', 'ICD', '2016' }, queryParams{query}} -SearchFormComponent -> SearchFormComponent: display catalog selection -SearchFormComponent --> MainComponent -deactivate SearchFormComponent - -create ResultsComp -MainComponent ->> ResultsComp : init -activate ResultsComp #lightblue - -ResultsComp -> Router: subscribe to changes -Router ->> ResultsComp: {params:{'de', 'ICD', '2016' }, queryParams{query}} - -ResultsComp ->> SearchService: subscribe to changes -activate SearchService #lightgrey - -group search query in route params - - ResultsComp -> SearchService: search('de', 'ICD', '2016', query) - activate SearchService #lightgreen - - note over SearchService - do search - end note - - SearchService --> ResultsComp: searchResults:CatalogElement[] - deactivate SearchService #lightgreen - ResultsComp -> ResultsComp : display results - -end - -ResultsComp --> MainComponent -deactivate ResultsComp - -deactivate SearchService - -MainComponent --> Router -deactivate MainComponent - -Router --> User: display -deactivate Router - - - -@enduml - diff --git a/documentation/uml/resolve_catalog_element.png b/documentation/uml/resolve_catalog_element.png deleted file mode 100644 index 6bb28d9..0000000 Binary files a/documentation/uml/resolve_catalog_element.png and /dev/null differ diff --git a/documentation/uml/search.png b/documentation/uml/search.png deleted file mode 100644 index 208ce66..0000000 Binary files a/documentation/uml/search.png and /dev/null differ diff --git a/documentation/uml/README.md b/documentation/uml/sequence/README.md similarity index 100% rename from documentation/uml/README.md rename to documentation/uml/sequence/README.md diff --git a/documentation/uml/sequence/change_catalog.png b/documentation/uml/sequence/change_catalog.png new file mode 100644 index 0000000..eb7e28a Binary files /dev/null and b/documentation/uml/sequence/change_catalog.png differ diff --git a/documentation/uml/change_catalog.puml b/documentation/uml/sequence/change_catalog.puml similarity index 100% rename from documentation/uml/change_catalog.puml rename to documentation/uml/sequence/change_catalog.puml diff --git a/documentation/uml/sequence/language.png b/documentation/uml/sequence/language.png new file mode 100644 index 0000000..cf2b4f5 Binary files /dev/null and b/documentation/uml/sequence/language.png differ diff --git a/documentation/uml/sequence/language.puml b/documentation/uml/sequence/language.puml new file mode 100644 index 0000000..a637599 --- /dev/null +++ b/documentation/uml/sequence/language.puml @@ -0,0 +1,44 @@ +@startuml +actor User +control Router <<@angular>> #orange + +entity LanguageGuard #lightgreen +entity TranslateService <> #orange + +User -> Router: / + +activate Router #orange + +note over Router + / +end note + +Router -> LanguageGuard: canActivate() +activate LanguageGuard #lightgreen +LanguageGuard -> LanguageGuard: +note right + get :lang from cookie, browser or use default +end note +LanguageGuard ->> Router: /:lang +deactivate LanguageGuard + +note over Router + /:lang +end note + +Router -> LanguageGuard: canActivate(:lang) +activate LanguageGuard #lightgreen + +LanguageGuard ->> TranslateService: setLanguage(:lang) +LanguageGuard --> Router: grant access +deactivate LanguageGuard + +Router -> Router: redirect to /:lang/ICD + +...resolve catalog route... + +Router --> User: display +deactivate Router + + +@enduml diff --git a/documentation/uml/sequence/page_load.png b/documentation/uml/sequence/page_load.png new file mode 100644 index 0000000..b654de8 Binary files /dev/null and b/documentation/uml/sequence/page_load.png differ diff --git a/documentation/uml/sequence/page_load.puml b/documentation/uml/sequence/page_load.puml new file mode 100644 index 0000000..a2187ab --- /dev/null +++ b/documentation/uml/sequence/page_load.puml @@ -0,0 +1,130 @@ + +@startuml +actor User +control Router <<@angular>> #orange + +entity LanguageGuard #lightgreen +entity CatalogVersionService as VersionService #lightgreen +'database search.eonum <> #orange +participant MainComponent #lightblue +participant SearchFormComponent #lightblue +participant SearchResultsComponent as ResultsComp #lightblue +participant DetailComponent #lightblue + +== Page Load, Route resolving == + +User -> Router: + +note right #lightgreen + /:lang/:catalog/:version/:type/:code +end note + +activate Router #orange + +note over Router + / +end note + +note over Router #lightblue + init AppComponent +end note + + +Router -> VersionService +activate VersionService #lightgreen + +VersionService -> VersionService: loadVersions() +note left #lightgrey + from 'assets/versions.json' +end note +VersionService --> Router +deactivate VersionService + + + + + +note over Router + /:lang +end note + +Router -> LanguageGuard: canActivate(:lang) + +activate LanguageGuard #lightgreen + +note over LanguageGuard + validate and set Language +end note +LanguageGuard --> Router: grant access +deactivate LanguageGuard + +note over Router + /:lang/:catalog/:version +end note + + + + +create MainComponent + +... CatalogResolver validates catalog and resolves displayInfos ... + +Router -> MainComponent: init +activate MainComponent #lightblue + +MainComponent ->> Router: subscribe to changes + + +Router ->> MainComponent: {params:{'de', 'ICD', '2016' }, queryParams{query}} + +create SearchFormComponent +MainComponent ->> SearchFormComponent: init +activate SearchFormComponent #lightblue + +SearchFormComponent -> Router: subscribe to changes +Router ->> SearchFormComponent: {data:{displayInfos},params:{'de', 'ICD', '2016' }, queryParams{query}} +SearchFormComponent -> SearchFormComponent: display catalog selection +SearchFormComponent --> MainComponent +deactivate SearchFormComponent + +create ResultsComp +MainComponent ->> ResultsComp : init +activate ResultsComp #lightblue + +ResultsComp -> Router: subscribe to changes +Router ->> ResultsComp: {params:{'de', 'ICD', '2016' }, queryParams{query}} + +note over ResultsComp + subscribe to CatalogSearchService +end note + +ResultsComp --> MainComponent +deactivate ResultsComp + + +MainComponent --> Router +deactivate MainComponent + +note over Router + /:lang/:catalog/:version/:type/:code +end note + +create DetailComponent + +... CatalogElementResolver loads CatalogElement for hiererchy ... + +Router -> DetailComponent: init +activate DetailComponent #lightblue + +DetailComponent -> Router: subscribe to changes +Router ->> DetailComponent: data:{catalogElement} + +DetailComponent -> DetailComponent: display element +DetailComponent --> Router +Router --> User: display +deactivate Router + + + +@enduml + diff --git a/documentation/uml/sequence/resolve_catalog.png b/documentation/uml/sequence/resolve_catalog.png new file mode 100644 index 0000000..b148e4d Binary files /dev/null and b/documentation/uml/sequence/resolve_catalog.png differ diff --git a/documentation/uml/sequence/resolve_catalog.puml b/documentation/uml/sequence/resolve_catalog.puml new file mode 100644 index 0000000..600aca0 --- /dev/null +++ b/documentation/uml/sequence/resolve_catalog.puml @@ -0,0 +1,78 @@ + +@startuml +actor User +control Router <<@angular>> #orange +participant SearchFormComponent #lightblue + +entity CatalogResolver #lightgreen +'database search.eonum <> #orange +entity CatalogVersionService as VersionService #lightgreen + +== Resolve and validate route to catalog == + +User -> Router: /... +activate Router #orange + +Router ->> CatalogResolver: resolve(route) + +activate CatalogResolver #lightgreen +alt route = :lang/:catalog + CatalogResolver -> CatalogResolver: getActiveVersion(:lang, :catalog) + note right + if not set, get first version + or navigate to :lang/, if + catalog does not exist + end note + CatalogResolver ->> Router: navigate :lang/:catalog/:version + +else route = :lang/:catalog/:version... + CatalogResolver -> VersionService: versionExists(:lang, :catalog, :version) + activate VersionService #lightgreen + + alt version does not exist + VersionService --> CatalogResolver: false + + CatalogResolver ->> Router: navigate :lang/:catalog + else version exists + alt route=:lang/:catalog/:version + + VersionService --> CatalogResolver: true + deactivate VersionService + note over CatalogResolver + navigate to root element + end note + CatalogResolver ->> Router: navigate :lang/:catalog/:version/:type/:code + + else route=:lang/:catalog/:version/:type/:code + CatalogResolver -> CatalogResolver: activateVersion (:lang, :catalog, :version) + + loop for catalog in catalogs + CatalogResolver -> VersionService: getVersions (:lang, catalog) + activate VersionService #lightgreen + VersionService --> CatalogResolver: version[] + deactivate VersionService #lightgreen + + CatalogResolver -> CatalogResolver: getActivateVersion (:lang, catalog): version + CatalogResolver -> CatalogResolver: displayInfos.add({versions[], version}) + end + CatalogResolver ->> Router: displayInfos:DisplayInfo[] + deactivate CatalogResolver + + Router ->> SearchFormComponent: displayInfos + activate SearchFormComponent #lightblue + SearchFormComponent -> SearchFormComponent: display catalog selection + SearchFormComponent --> Router + deactivate SearchFormComponent + + ...resolve catalog element... + + Router --> User: display + deactivate Router + end + + end + +end + + +@enduml diff --git a/documentation/uml/sequence/resolve_catalog_element.png b/documentation/uml/sequence/resolve_catalog_element.png new file mode 100644 index 0000000..bf0b521 Binary files /dev/null and b/documentation/uml/sequence/resolve_catalog_element.png differ diff --git a/documentation/uml/resolve_catalog_element.puml b/documentation/uml/sequence/resolve_catalog_element.puml similarity index 66% rename from documentation/uml/resolve_catalog_element.puml rename to documentation/uml/sequence/resolve_catalog_element.puml index b8a709e..3004a3d 100644 --- a/documentation/uml/resolve_catalog_element.puml +++ b/documentation/uml/sequence/resolve_catalog_element.puml @@ -4,41 +4,35 @@ control Router <<@angular>> #orange entity CatalogElementResolver as ElementResolver #lightgreen entity CatalogElementCache as Cache #lightgrey entity "ICDCatalog \n <>" as ICD #lightgreen -entity CatalogService #lightgreen -database search.eonum <> #orange + participant DetailComponent #lightblue == Navigate to CatalogHierarchy == -User -> Router: de/ICD/ICD10-GM-2016/icds/E20.0 +User -> Router: activate Router #orange +note over Router + de/ICD/ICD10-GM-2016/icds/E20.0 +end note + ...resolve language and catalog... Router -> ElementResolver: resolve(...) +activate ElementResolver #lightgrey -ElementResolver -> Cache: getElement('de', '2016','icds', 'E20.0') +ElementResolver -> Cache: getElement('de', 'ICD10-GM-2016','icds', 'E20.0') activate Cache #lightgreen Cache -> ElementResolver: element:CatalogElement or Null deactivate Cache #lightgreen -activate ElementResolver #lightgrey group element not in cache - ElementResolver --> ICD: getElement('2016', 'icds', 'E20.0') + ElementResolver --> ICD: getElement('de','ICD10-GM-2016', 'icds', 'E20.0') activate ICD #lightgreen - ICD -> CatalogService: init(self.config) - activate CatalogService #lightgreen - CatalogService --> ICD - ICD ->> CatalogService: getByCode('2016', 'icds', 'E20.0') - CatalogService ->> search.eonum : de/icds/ICD10-GM-2016/E20 - - activate search.eonum #orange - search.eonum --> CatalogService: element:json - deactivate search.eonum - - CatalogService --> ICD: element: CatalogElement - deactivate CatalogService + note over ICD + get element from eonum API + end note ICD --> ElementResolver: element: CatalogElement deactivate ICD @@ -52,7 +46,11 @@ group element not in cache loop for all parent elements ElementResolver --> ICD: getElement(...) activate ICD #lightgreen - ... + + note over ICD + get element from eonum API + end note + ICD --> ElementResolver: element: CatalogElement deactivate ICD ElementResolver -> Cache: save element @@ -67,7 +65,13 @@ ElementResolver --> Router: element:CatalogElement deactivate ElementResolver Router -> DetailComponent: element + +activate DetailComponent #lightblue + DetailComponent --> Router +deactivate DetailComponent #lightblue + Router -> User: display +deactivate Router @enduml diff --git a/documentation/uml/sequence/search.png b/documentation/uml/sequence/search.png new file mode 100644 index 0000000..1e2ad12 Binary files /dev/null and b/documentation/uml/sequence/search.png differ diff --git a/documentation/uml/search.puml b/documentation/uml/sequence/search.puml similarity index 62% rename from documentation/uml/search.puml rename to documentation/uml/sequence/search.puml index cfeb572..b06a80c 100644 --- a/documentation/uml/search.puml +++ b/documentation/uml/sequence/search.puml @@ -3,8 +3,7 @@ actor User control Router <<@angular>> #orange entity "ICDCatalog \n <>" as ICD #lightgreen -entity CatalogService #lightgreen -database search.eonum <> #orange + entity CatalogSearchService as SearchService #lightgreen participant SearchFormComponent #lightblue participant SearchResultsComponent as ResultsComp #lightblue @@ -16,40 +15,33 @@ User -> SearchFormComponent: enter search-query: 'a query' activate SearchFormComponent #lightblue SearchFormComponent -> Router: navigate({query:'a query'} -activate Router #orange - -Router --> SearchFormComponent - deactivate SearchFormComponent #lightblue -activate ResultsComp #lightblue +activate Router #orange + Router ->> ResultsComp: {params:{'de', 'ICD', '2016' }, queryParams{query}} -activate SearchService #lightgrey +activate ResultsComp #lightblue group search query in route params ResultsComp -> SearchService: search('de', 'ICD', '2016', query) activate SearchService #lightgreen - + note over SearchService + end note SearchService ->> ICD: search('de', '2016', query) - activate ICD #lightgreen - ICD -> CatalogService: init(self.config) - activate CatalogService #lightgreen - CatalogService -> ICD - ICD ->> CatalogService: search(query) - CatalogService ->> search.eonum : .../search?search=query - activate search.eonum #orange - search.eonum --> CatalogService: results: json - deactivate search.eonum - CatalogService --> ICD: searchResults - deactivate CatalogService - ICD --> SearchService: searchResults: CatalogElement[] - deactivate ICD + activate ICD #lightgreen + + note over ICD + Search in eonum API + end note + + ICD --> SearchService: searchResults: CatalogElement[] + deactivate ICD SearchService --> ResultsComp: searchResults:CatalogElement[] deactivate SearchService #lightgreen @@ -57,11 +49,9 @@ group search query in route params end +ResultsComp --> Router deactivate ResultsComp -deactivate SearchService - - Router --> User: display deactivate Router diff --git a/src/app/service/catalog.service.ts b/src/app/service/catalog.service.ts index 0d15545..a964e69 100644 --- a/src/app/service/catalog.service.ts +++ b/src/app/service/catalog.service.ts @@ -15,8 +15,8 @@ export class CatalogService implements ICatalogService { private config: CatalogConfiguration; public constructor(private http: Http, - private translate: TranslateService, - @Inject('ILoggerService') private logger: ILoggerService) { + private translate: TranslateService, + @Inject('ILoggerService') private logger: ILoggerService) { } /** @@ -126,10 +126,10 @@ export class CatalogService implements ICatalogService { } private async getSingleElementForTypeByCode(elementType: string, - version: string, - code: string, - query?: string, - language?: string): Promise { + version: string, + code: string, + query?: string, + language?: string): Promise { const locale: string = language || this.getLocale(); let url = `${this.baseUrl}${locale}/${elementType}/${version}/${code}?show_detail=1`;