Skip to content

Commit 167274b

Browse files
committed
Change webpack to localhost
1 parent 0f6ca65 commit 167274b

File tree

13 files changed

+63
-1207
lines changed

13 files changed

+63
-1207
lines changed

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ParseRx
2-
Medication sig parser.
2+
Medication sig parser w/ API and frontend review tool. Supports parsing individual sigs and batch parsing CSV sigs. Supports feedback loop from "customers" via API call.
33

44

55
## Getting started
@@ -74,6 +74,8 @@ python manage.py runserver localhost:8000
7474
Recommend using Postman
7575

7676
1.) Authenticate with user
77+
78+
```
7779
POST localhost:8000/auth/token/login/
7880
Headers
7981
Content-Type application/json
@@ -86,8 +88,11 @@ Response
8688
{
8789
"auth_token": "<auth token>"
8890
}
91+
```
8992

9093
2.) Run query via API
94+
95+
```
9196
POST localhost:8000/sig/
9297
Headers
9398
Content-Type application/json
@@ -96,6 +101,7 @@ Body
96101
{
97102
"sig_text": "take 1-2 tabs po qid prn anxiety x7d"
98103
}
104+
```
99105

100106

101107
## Parsing / reparsing an entire CSV of sigs
@@ -106,11 +112,14 @@ NOTE: to change the csv file that the API runs:
106112
- The csv file is stored in parserx/parsers/csv
107113

108114
Edit the name of the csv file in parserx.io/sig/views.py to be the csv you want to parse.
115+
109116
***NOTE: ensure you have converted it to just one column full of sigs with no header.
110117

111118
Postman
112119

113120
1.) Authenticate with superuser
121+
122+
```
114123
POST localhost:8000/auth/token/login/
115124
Headers
116125
Content-Type application/json
@@ -123,19 +132,25 @@ Response
123132
{
124133
"auth_token": "<auth token>"
125134
}
135+
```
126136

127137
2.) Run ParseRx on csv file via API
138+
139+
```
128140
POST localhost:8000/csv_sig/
129141
Headers
130142
Content-Type application/json
131143
Authorization Token <auth token>
144+
```
132145

133146

134147
## Submiting batch sig reviews to ParseRx via API (feedback loop)
135148

136149
This would be for a "customer" that is receiving parsed sigs and wants to send back some feedback as a batch every night via the API.
137150

138151
1.) Get auth token from ParseRx
152+
153+
```
139154
POST api.parserx.io/auth/token/login/
140155
Headers
141156
Content-Type application/json
@@ -148,8 +163,11 @@ Response
148163
{
149164
"auth_token": "<auth token>"
150165
}
166+
```
151167

152168
2.) Sumbit batch reviews to ParseRx
169+
170+
```
153171
POST api.parserx.io/sig_reviewed/
154172
Headers
155173
Content-Type application/json
@@ -162,4 +180,31 @@ Body
162180
"sig_correct": "<true|false>",
163181
"sig_corrected": "<sig_corrected>"
164182
}
183+
184+
...
185+
165186
]
187+
```
188+
189+
190+
## Starting the frontend
191+
192+
If your API is hosted somewhere other than localhost:8000, go to frontend/webpack.config.js and change `apiUrl` (near the bottom) to the correct URL.
193+
194+
```
195+
cd frontend
196+
npm install
197+
npm start
198+
```
199+
200+
Go to localhost:8080
201+
202+
Log in with superuser username and password.
203+
204+
Once logged in, you should be taken back to the homepage. You need to refresh the homepage to see additional options in the nav bar for "Review" and "Demo".
205+
206+
Review - lets you review previously parsed sigs and mark them as correct or incorrect. If incorrect, you can select which components are incorrect. This also gets stored in the database.
207+
208+
Demo - lets you enter individual free text sigs and shows the parsed response.
209+
210+
Sometimes a malformed parsed sig will prevent the Review page from loading. If this happens, either remove the sig from the database in MySQL phpMyadmin or enter 10 new sigs in the Demo page to clear it out.

frontend/package-lock.json

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/App.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import { LoginPage } from './LoginPage';
88
import { LogoutPage } from './LogoutPage';
99
import { SigPage } from './SigPage';
1010
import { DocsPage } from './DocsPage';
11-
import { TermsOfServicePage } from './TermsOfServicePage';
12-
import { DisclaimerPage } from './DisclaimerPage';
13-
import { PrivacyPolicyPage } from './PrivacyPolicyPage';
1411
import { DemoPage } from './DemoPage';
1512

1613
import './App.css';
@@ -67,9 +64,6 @@ class App extends React.Component {
6764
<PrivateRoute exact path="/sig" component={SigPage} />
6865
<PrivateRoute exact path="/demo" component={DemoPage} />
6966
<Route path="/docs" component={DocsPage} />
70-
<Route path="/terms-of-service" component={TermsOfServicePage} />
71-
<Route path="/disclaimer" component={DisclaimerPage} />
72-
<Route path="/privacy-policy" component={PrivacyPolicyPage} />
7367
<Route path="/" component={HomePage} />
7468
<Route component={HomePage} />
7569
</Switch>

frontend/src/DisclaimerPage/DisclaimerPage.jsx

Lines changed: 0 additions & 102 deletions
This file was deleted.

frontend/src/DisclaimerPage/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

frontend/src/DocsPage/DocsPage.jsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ class DocsPage extends React.Component {
2424
<Col>
2525
<h1>API Documentation</h1>
2626
<div className="stackedit__html">
27-
<p>
28-
Before getting started,{" "}
29-
<a href="mailto:hello@parserx.io">request an API key</a>. Please review our{" "}
30-
<a href="https://parserx.io/terms-of-service">Terms Of Service</a> before deploying API
31-
integration to avoid any unexpected account issues.
32-
</p>
3327
<h2 id="request-authentication">Request Authentication</h2>
3428
<p>All requests must have an API key.</p>
3529
<p>

frontend/src/HomePage/HomePage.jsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,6 @@ class HomePage extends React.Component {
130130
</Col>
131131
</Row>
132132

133-
<Row className="featurette">
134-
<Col md={{ span: 6, order: 2 }} className="text-center">
135-
<img width="50%" src={phoneConsultation} />
136-
</Col>
137-
<Col md={{ span: 6, order: 1 }}>
138-
<h1>Contact us</h1>
139-
<p>Interested in a demo, have a few questions, or just want to chat?</p>
140-
<h3><span className="material-icons green">send</span> Email</h3>
141-
<p>Shoot us a quick email at <a href="mailto:hello@parserx.io">hello@parserx.io</a>.</p>
142-
<h3><span className="material-icons purple">speaker_notes</span> Contact form</h3>
143-
<p>Send us a message via our easy to use <a href="https://joey708693.typeform.com/to/MNtm28sF" target="_blank"><span className="material-icons"><small>launch</small></span>contact form</a>.</p>
144-
<h3><span className="material-icons red">email</span> Mailing list</h3>
145-
<p>Get updates on new features by signing up for our <a href="https://mailchi.mp/d4318280990f/parserx-mailing-list" target="_blank"><span className="material-icons"><small>launch</small></span>mailing list</a>.</p>
146-
147-
</Col>
148-
</Row>
149133
</Container>
150134
</div>
151135
);

0 commit comments

Comments
 (0)