Skip to content

Commit

Permalink
feat(#661): add new lab type and test backend
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Nov 13, 2024
1 parent 648c4a0 commit 3b99c6a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/lib/common/constants.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:url_launcher/url_launcher.dart';

Uri anniUrl([String slug = '']) =>
Uri.http('vm-slosarek01.dhclab.i.hpi.de:8000', 'api/v1/$slug');
Uri.https('hpi-annotation-service.duckdns.org', 'api/v1/$slug');

final geneticInformationUrl = Uri.https(
'medlineplus.gov',
Expand Down
34 changes: 34 additions & 0 deletions app/lib/login/models/app_share_flow_lab.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import '../../common/module.dart';
import 'lab.dart';

class AppShareFlowLab extends Lab {
AppShareFlowLab({
required super.name,
required this.shareAppName,
});

String shareAppName;
late Uri publishUrl;
late Map<String, String>? publishHeaders;

@override
Future<void> authenticate() async {
// TODO: introduce static properties for loading message and whether loading
// can be canceled (throws LabAuthenticationCanceled)
// TODO: get query data from DWA via deeplink (Android-only suffient)
// TODO: show error for iOS until implemented
// THIS IS FOR TESTING, SHOULD GET FROM DWA
publishUrl = Uri.parse(
'https://hpi-datastore.duckdns.org/userdata?id=1e006a69-b693-43d2-a318-22904e305b5c',
);
publishHeaders = null;
}

@override
Future<(List<LabResult>, List<String>)> loadData() async {
return fetchData(
publishUrl,
headers: publishHeaders,
);
}
}
5 changes: 5 additions & 0 deletions app/lib/login/pages/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ import 'package:provider/provider.dart';

import '../../../common/module.dart';
import '../cubit.dart';
import '../models/app_share_flow_lab.dart';
import '../models/oauth_authorization_code_flow_lab.dart';

final labs = [
AppShareFlowLab(
name: 'Health-X via Data Wallet App',
shareAppName: 'Data Wallet App',
),
OAuthAuthorizationCodeFlowLab(
name: 'Mount Sinai Health System',
authUrl: Uri.http('vm-slosarek01.dhclab.i.hpi.de:28080', 'realms/pharme/protocol/openid-connect/auth'),
Expand Down
3 changes: 3 additions & 0 deletions pharme.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"drugclass",
"drugid",
"drugrecommendation",
"duckdns",
"duloxetine",
"endoxifen",
"Ezallor",
Expand All @@ -69,6 +70,7 @@
"haplotype",
"haplotypes",
"Hasso",
"healthx",
"Hlab",
"horiz",
"hyperbilirubinemia",
Expand Down Expand Up @@ -109,6 +111,7 @@
"Pharmacogenetics",
"pharmacogenomic",
"pharmacogenomics",
"pharme",
"PharMe",
"phenoconversion",
"Plattner",
Expand Down

0 comments on commit 3b99c6a

Please sign in to comment.