Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
common image and js sources
Browse files Browse the repository at this point in the history
  • Loading branch information
fwhigh committed Mar 13, 2014
1 parent 638780e commit bc05b22
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 96 deletions.
78 changes: 24 additions & 54 deletions inst/anc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,7 @@
<script src="../js/jquery-1.10.2.min.js"></script>
<script src="../js/opencpu-0.4.js"></script>
<script src="../js/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>

<script>
$(function(){
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/r");
editor.setFontSize("14px");

//This app requires OpenCPU 1.0.1 or higher!

function domarkdown(e){
var req = ocpu.call("rmdtext", {
text : editor.getSession().getValue()
}, function(session){
$("iframe").attr('src', session.getFileURL("output.html"));
}).fail(function(text){
alert("Error: " + req.responseText);
});
}

//auto run after 3 seconds of no activity
var update = _.debounce(domarkdown, 3000);

//register event
editor.on("change", update);

//init on start
domarkdown();
});

</script>
<script src="../js/markdownapp.js" type="text/javascript" charset="utf-8"></script>

<style type="text/css" media="screen">

Expand Down Expand Up @@ -123,8 +93,8 @@
```

**What is the year of this estimate? It is okay if it is approximate,
but it should at least be roughly around `r
country.population.year`.**
but it should at least be roughly around
`r country.population.year`.**

```{r}
catchment.population.year <- 2012
Expand All @@ -143,11 +113,11 @@
n.women.covered <- 100000
```

You are embarking on an ANC projection for `r catchment.name`, `r
country.name`. The population of `r catchment.name` is `r
sprintf("%i",catchment.population)`, which is `r
sprintf("%.2f",catchment.population/country.population*100)`% of the
population of r country.name`. Your baseline year for demographic
You are embarking on an ANC projection for `r catchment.name`,
`r country.name`. The population of `r catchment.name` is
`r sprintf("%i",catchment.population)`, which is
`r sprintf("%.2f",catchment.population/country.population*100)`%
of the population of r country.name`. Your baseline year for demographic
projections is `r country.population.year`, and the year you want to
model an increase in coverage is `r first.anc.year`.

Expand All @@ -160,7 +130,7 @@

Click _New_ or _New projection_.

![title](/ocpu/library/MedicMobileImpact/anc/images/Spectrum_first_screen.png)
![title](/ocpu/library/MedicMobileImpact/images/Spectrum_first_screen.png)

In the _New_ dialog, under “Set a name...”, set the name for this
projection. Make it descriptive of the country, county, and possibly
Expand Down Expand Up @@ -192,7 +162,7 @@

Hit _Ok_. If you then see the following dialog, just hit _Cancel_.

![title](/ocpu/library/MedicMobileImpact/anc/images/New_Spectrum_version_creation_dialog.png)
![title](/ocpu/library/MedicMobileImpact/images/New_Spectrum_version_creation_dialog.png)

# Do a demographics projection

Expand Down Expand Up @@ -231,9 +201,9 @@
spectrum.catchment.male.population + spectrum.catchment.female.population
```

The total population you multiplied down to is `r
sprintf("%i",spectrum.catchment.population)`, which is `r
sprintf("%.1f",(1-(spectrum.catchment.population)/catchment.population)*100)`%
The total population you multiplied down to is
`r sprintf("%i",spectrum.catchment.population)`, which is
`r sprintf("%.1f",(1-(spectrum.catchment.population)/catchment.population)*100)`%
different from the catchment population you estimated. If the
difference is 10% or smaller, you should be fine.

Expand All @@ -245,7 +215,7 @@
for your catchment from the year after your first year to your final
year.

![title](/ocpu/library/MedicMobileImpact/anc/images/Demographic_Projection.png)
![title](/ocpu/library/MedicMobileImpact/images/Demographic_Projection.png)

**What, in whole numbers (not in millions), is the total projected
population size in `r first.anc.year`?**
Expand All @@ -255,8 +225,8 @@
```

The projection population for your first year of increased ANC
coverage (`r first.anc.year`) is `r
sprintf("%.2f",(spectrum.catchment.population.first.anc.year/catchment.population-1)*100)`%
coverage (`r first.anc.year`) is
`r sprintf("%.2f",(spectrum.catchment.population.first.anc.year/catchment.population-1)*100)`%
bigger than the population in `r catchment.population.year`, which was
`r sprintf("%i",catchment.population)`.

Expand All @@ -266,7 +236,7 @@
birth rate for your catchment from the year after your first year to
your final year.

![title](/ocpu/library/MedicMobileImpact/anc/images/Crude_Birth_Rate_Projection.png)
![title](/ocpu/library/MedicMobileImpact/images/Crude_Birth_Rate_Projection.png)

This is the number of births per 1000 people. **What is the CBR for
`r first.anc.year`?**
Expand All @@ -280,9 +250,9 @@
spectrum.cbr.first.anc.year/1000*catchment.population
```

Given this value, the estimated number of pregnant women in `r
catchment.name` in `r first.anc.year` is `r
sprintf("%.0f",n.pregnant.women.first.anc.year)`.
Given this value, the estimated number of pregnant women in
`r catchment.name` in `r first.anc.year` is
`r sprintf("%.0f",n.pregnant.women.first.anc.year)`.

# Scale up ANC in LiST

Expand All @@ -297,8 +267,8 @@
baseline.anc.coverage.rate <- 44.8
```

By default, LiST is assuming that `r
sprintf("%.f",baseline.anc.coverage.rate/100*n.pregnant.women.first.anc.year)`
By default, LiST is assuming that
`r sprintf("%.f",baseline.anc.coverage.rate/100*n.pregnant.women.first.anc.year)`
out of `r sprintf("%.f",n.pregnant.women.first.anc.year)` pregant
women are being treated with antenatal care. This coverage rate is
equal to the national coverage rate by default, and we have just
Expand Down Expand Up @@ -327,7 +297,7 @@
to replicate the number you just entered for all subsequent years.
You should see something like this.

![title](/ocpu/library/MedicMobileImpact/anc/images/ANC_Coverage_Table.png)
![title](/ocpu/library/MedicMobileImpact/images/ANC_Coverage_Table.png)

Click _Ok_ to save changes and exit the dialog.

Expand All @@ -336,7 +306,7 @@
the dialog, select _Table_ and hit _Ok_. You may see a table like
this.

![title](/ocpu/library/MedicMobileImpact/anc/images/Neonatal.png)
![title](/ocpu/library/MedicMobileImpact/images/Neonatal.png)

Zero or negative numbers mean you have not prevented any deaths.
Positive numbers tell you how many lives you have saved per year. You
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
27 changes: 27 additions & 0 deletions inst/js/markdownapp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
$(function(){
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/r");
editor.setFontSize("14px");

//This app requires OpenCPU 1.0.1 or higher!

function domarkdown(e){
var req = ocpu.call("rmdtext", {
text : editor.getSession().getValue()
}, function(session){
$("iframe").attr('src', session.getFileURL("output.html"));
}).fail(function(text){
alert("Error: " + req.responseText);
});
}

//auto run after 2 seconds of no activity
var update = _.debounce(domarkdown, 2000);

//register event
editor.on("change", update);

//init on start
domarkdown();
});
Binary file removed inst/vaccine/images/Spectrum_first_screen.png
Binary file not shown.
57 changes: 15 additions & 42 deletions inst/vaccine/index.html
Original file line number Diff line number Diff line change
@@ -1,42 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Medic Mobile ANC impact worksheet</title>
<title>Medic Mobile vaccine impact worksheet</title>

<script src="../js/underscore-min.js"></script>
<script src="../js/jquery-1.10.2.min.js"></script>
<script src="../js/opencpu-0.4.js"></script>
<script src="../js/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>

<script>
$(function(){
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/r");
editor.setFontSize("14px");

//This app requires OpenCPU 1.0.1 or higher!

function domarkdown(e){
var req = ocpu.call("rmdtext", {
text : editor.getSession().getValue()
}, function(session){
$("iframe").attr('src', session.getFileURL("output.html"));
}).fail(function(text){
alert("Error: " + req.responseText);
});
}

//auto run after 3 seconds of no activity
var update = _.debounce(domarkdown, 3000);

//register event
editor.on("change", update);

//init on start
domarkdown();
});
</script>
<script src="../js/markdownapp.js" type="text/javascript" charset="utf-8"></script>

<style type="text/css" media="screen">

Expand Down Expand Up @@ -117,7 +88,7 @@

Click _New_ or _New projection_.

![title](/ocpu/library/MedicMobileImpact/vaccine/images/Spectrum_first_screen.png)
![title](/ocpu/library/MedicMobileImpact/images/Spectrum_first_screen.png)

In the _New_ dialog, under “Set a name...”, set the name for this
projection. Make it descriptive of the country, locale and
Expand Down Expand Up @@ -151,10 +122,10 @@
Select _Results &rarr; Age Groups &rarr; All Age Groups_. You should
see a popup titled _Configure - All Age Groups_.

![title](/ocpu/library/MedicMobileImpact/vaccine/images/AllAgeGroups.png)
![title](/ocpu/library/MedicMobileImpact/images/AllAgeGroups.png)

The defaults should be fine here. Make sure that _First year_ is `r
first.anc.year` and that _Display Interval_ is Single year.
The defaults should be fine here. Make sure that _First year_ is
`r first.anc.year` and that _Display Interval_ is Single year.

Click _OK_.

Expand All @@ -164,7 +135,7 @@
year increments. When this bug is fixed, the 0-1 age group should be
used.

![title](/ocpu/library/MedicMobileImpact/vaccine/images/PopByAgeAndSex.png)
![title](/ocpu/library/MedicMobileImpact/images/PopByAgeAndSex.png)

**What is the number in the upper left box (`r first.anc.year` Total 0-4`)?**

Expand All @@ -190,9 +161,11 @@

Make sure you’re in the _Modules_ tab. Select the _LiST_ module.

Select _Coverage_. In the dialog, select the _Vaccines_ tab. You’ll see nationally averaged coverage rates already populated in the table. Look at the year in the table corresponding to `r first.anc.year`.
Select _Coverage_. In the dialog, select the _Vaccines_ tab. You’ll
see nationally averaged coverage rates already populated in the table.
Look at the year in the table corresponding to `r first.anc.year`.

![title](/ocpu/library/MedicMobileImpact/vaccine/images/VaccineTab.png)
![title](/ocpu/library/MedicMobileImpact/images/VaccineTab.png)

**What is the coverage rate shown for Polio in `r first.anc.year`?**

Expand Down Expand Up @@ -244,12 +217,12 @@

*`r sprintf("%.1f",new.measles.coverage.rate*100)`*

Now update the coverage rate for those three vaccines in `r
first.anc.year`. To do so click the appropriate box and update the
Now update the coverage rate for those three vaccines in `r first.anc.year`.
To do so click the appropriate box and update the
value. To update DPT you may need to uncheck the _Pentavalent--
automatically calculate components_ checkbox.

![title](/ocpu/library/MedicMobileImpact/vaccine/images/VaccineTabUpdated.png)
![title](/ocpu/library/MedicMobileImpact/images/VaccineTabUpdated.png)

Click _Ok_ to save changes and exit the dialog.

Expand All @@ -258,7 +231,7 @@
relative to impact year_. In the dialog, select _Table_ and hit _Ok_.
You should see a table like this.

![title](/ocpu/library/MedicMobileImpact/vaccine/images/ChildrenSaved.png)
![title](/ocpu/library/MedicMobileImpact/images/ChildrenSaved.png)

Zero or negative numbers mean you haven't prevented any deaths.
Positive numbers tell you how many lives you've saved per year. The
Expand Down

0 comments on commit bc05b22

Please sign in to comment.