Blog

Coursehelp
February 6, 2019
QUESTION : No Comments

Moving from a fee-for-service to a managed care delivery s

Moving from a fee-for-service to a managed care delivery system set up a series of expectations (page 421). How many of these expectations are realistic? How many have been realized?

Expert Answer

Fee-for-service healthcare delivery system is a system in which doctors or physicians are paid for the service they provide to the patient. The downside of this

OR
OR

Have a Comment on this Question?

Questions viewed by other students


  • QUESTION : (Solved) : Code Used Increment Decrement Led Counter Using Switch S1 Msp432 P11 Increment S2 External Q34743850 . . .

    Below is code used to increment and decrement an LED counterusing a switch (S1) on the MSP432 P1.1 to increment; and (S2)externally connected to P5.0 and P5.2 to decrement the led.

    However, when pressing the increment button, it only works if S2is also pressed at the same time. What might be the problem here?Need help fixing this code or outlining any issues. THANK YOU!

    #include “msp.h”

    // Global variable used to hold the current state
    char currentState;

    // Global variable used to hold the number of pushes
    long int pushes;

    void countDown(void);
    void countUp(void);

    /*
    * Initialization function runs once before the state machinewhile(1) loop.
    */
    void init(void)
    {
    WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD; // Stop watchdogtimer
    P1DIR |= (BIT0); // Set P1.0 to output direction (RED — LED1)
    P2DIR |= (BIT2 + BIT1 + BIT0); // Set P2, bits 2, 1, 0 to output(RGB — LED 2)

    // P1 is set to input by default in the P1DIR reg
    P1DIR &= ~(BIT1); // So clearing it here is redundant
    // Set Buttons to input direction

    // Setting the internal resistor to be a pullup
    // may be redundant if button has an external pullup
    P1REN |= (BIT1); // enable internal resistor
    P1OUT |= (BIT1); // make internal resistor pullup

    P5DIR |= BIT0; // Set BIT 0 to output
    P5OUT |= BIT0; // Set BIT 0 as VCC

    P5DIR &= ~ (BIT2); // Makes this an input
    P5REN |= (BIT2); // Turns on internal resistor
    P5OUT &= ~(BIT2); // Make internal resistor pulldown

    currentState = 0; // Global variable init
    pushes = 0; // Global variable init

    P1OUT &= ~(BIT0); // Clear both LED 1 AND Led 2initially
    P2OUT &= ~(BIT2 + BIT1 + BIT0);
    }

    // Check S1 Button and count up if it is pressed
    char readS1Input(void)
    {
    char local = 0;

    // The P1IN register holds the logical values of the pins thatare
    // configured as inputs

    if (!(P1IN & BIT1)) { // Check for S1 input
    pushes = pushes + 1; // Code that executes when S1 button ispushed
    local = 1;
    __delay_cycles(10000); // Wait for debounce to end (bad code)
    countUp();
    while(!(P1IN & BIT1)) {
    // Wait for Up button to return to “normal”
    // Must re-read the input port
    // Not good code because loop could run forever
    }
    __delay_cycles(10000); // Again wait for debounce to end (again badcode)
    }
    return local;
    }

    // Check S2 Button and count down if it is pressed
    char readS2Input(void)
    {
    char local = 0;

    // The P1IN registers hold the logical values of the pins thatare
    // configured as inputs

    if (!(P5IN & BIT2)) { // Check for S2 input
    pushes = pushes + 1; // Code that executes when S2 button ispushed
    local = 2;
    __delay_cycles(10000); // Wait for debounce to end (bad code)
    countDown();
    while(!(P5IN & BIT2)) {
    // Wait for Up button to return to “normal”
    // Must re-read the input port
    // Not good code because loop could run forever
    }
    __delay_cycles(10000); // Again wait for debounce to end (again badcode)
    }
    return local;
    }

    void countUp(void)
    {
    P1OUT |= BIT0; // Set LED1 to indicate increment
    switch (currentState){
    case 0 :
    currentState = 1;
    P2OUT &= ~(BIT2 + BIT1);
    P2OUT |= (BIT0);
    break;
    case 1 :
    currentState = 2;
    P2OUT &= ~(BIT2 + BIT0);
    P2OUT |= (BIT1);
    break;
    case 2 :
    currentState = 3;
    P2OUT &= ~(BIT2);
    P2OUT |= (BIT1 + BIT0);
    break;
    case 3 :
    currentState = 4;
    P2OUT &= ~(BIT0 + BIT1);
    P2OUT |= (BIT2);
    break;
    case 4 :
    currentState = 5;
    P2OUT &= ~(BIT1);
    P2OUT |= (BIT2 + BIT0);
    break;
    case 5 :
    currentState = 6;
    P2OUT &= ~(BIT0);
    P2OUT |= (BIT2 + BIT1);
    break;
    case 6 :
    currentState = 7;
    P2OUT |= (BIT2 + BIT1 + BIT0);
    break;
    case 7 :
    currentState = 0;
    P2OUT &= ~(BIT2 + BIT1 + BIT0);
    break;
    }
    }

    void countDown(void)
    {
    P1OUT &= ~(BIT0); // Turn off LED1 to indicate decrement
    switch (currentState){
    case 2 :
    currentState = 1;
    P2OUT &= ~(BIT2 + BIT1);
    P2OUT |= (BIT0);
    break;
    case 3 :
    currentState = 2;
    P2OUT &= ~(BIT2 + BIT0);
    P2OUT |= (BIT1);
    break;
    case 4 :
    currentState = 3;
    P2OUT &= ~(BIT2);
    P2OUT |= (BIT1 + BIT0);
    break;
    case 5 :
    currentState = 4;
    P2OUT &= ~(BIT0 + BIT1);
    P2OUT |= (BIT2);
    break;
    case 6 :
    currentState = 5;
    P2OUT &= ~(BIT1);
    P2OUT |= (BIT2 + BIT0);
    break;
    case 7 :
    currentState = 6;
    P2OUT &= ~(BIT0);
    P2OUT |= (BIT2 + BIT1);
    break;
    case 0 :
    currentState = 7;
    P2OUT |= (BIT2 + BIT1 + BIT0);
    break;
    case 1 :
    currentState = 0;
    P2OUT &= ~(BIT2 + BIT1 + BIT0);
    break;
    }
    }

    /**
    * main.c
    */
    void main(void)
    {
    WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD; // stop watchdogtimer
    init(); // One time initialization function

    /*
    * The main while loop of the state machine will constantly scan theinputs
    * and update the system based on those inputs
    * This version of the code updates the LED’s on the buttonpress
    */
    while(1) {
    readS1Input(); // Check the S1 button
    readS2Input(); // Check the S2 button

    }
    }

    Expert Answer


    . . .


    view full answer
  • QUESTION : (Solved) : Code Used Increment Decrement Led Counter Using Switch S1 Msp432 P11 Increment S2 External Q34743744 . . .

    Below is code used to increment and decrement an LED counterusing a switch (S1) on the MSP432 P1.1 toincrement; and (S2) externally connected to P5.0 andP5.2 to decrement the led.

    However, when pressing the increment button, it only works if S2is also pressed at the same time. What might be the problem here?Need help fixing this code or outlining any issues. THANK YOU!

    #include “msp.h”

    // Global variable used to hold the current state
    char currentState;

    // Global variable used to hold the number of pushes
    long int pushes;

    void countDown(void);
    void countUp(void);

    /*
    * Initialization function runs once before the state machinewhile(1) loop.
    */
    void init(void)
    {
    WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD; // Stop watchdogtimer
    P1DIR |= (BIT0); // Set P1.0 to output direction (RED — LED1)
    P2DIR |= (BIT2 + BIT1 + BIT0); // Set P2, bits 2, 1, 0 to output(RGB — LED 2)

    // P1 is set to input by default in the P1DIR reg
    P1DIR &= ~(BIT1); // So clearing it here is redundant
    // Set Buttons to input direction

    // Setting the internal resistor to be a pullup
    // may be redundant if button has an external pullup
    P1REN |= (BIT1); // enable internal resistor
    P1OUT |= (BIT1); // make internal resistor pullup

    P5DIR |= BIT0; // Set BIT 0 to output
    P5OUT |= BIT0; // Set BIT 0 as VCC

    P5DIR &= ~ (BIT2); // Makes this an input
    P5REN |= (BIT2); // Turns on internal resistor
    P5OUT &= ~(BIT2); // Make internal resistor pulldown

    currentState = 0; // Global variable init
    pushes = 0; // Global variable init

    P1OUT &= ~(BIT0); // Clear both LED 1 AND Led 2initially
    P2OUT &= ~(BIT2 + BIT1 + BIT0);
    }

    // Check S1 Button and count up if it is pressed
    char readS1Input(void)
    {
    char local = 0;

    // The P1IN register holds the logical values of the pins thatare
    // configured as inputs

    if (!(P1IN & BIT1)) { // Check for S1 input
    pushes = pushes + 1; // Code that executes when S1 button ispushed
    local = 1;
    __delay_cycles(10000); // Wait for debounce to end (bad code)
    countUp();
    while(!(P1IN & BIT1)) {
    // Wait for Up button to return to “normal”
    // Must re-read the input port
    // Not good code because loop could run forever
    }
    __delay_cycles(10000); // Again wait for debounce to end (again badcode)
    }
    return local;
    }

    // Check S2 Button and count down if it is pressed
    char readS2Input(void)
    {
    char local = 0;

    // The P1IN registers hold the logical values of the pins thatare
    // configured as inputs

    if (!(P5IN & BIT2)) { // Check for S2 input
    pushes = pushes + 1; // Code that executes when S2 button ispushed
    local = 2;
    __delay_cycles(10000); // Wait for debounce to end (bad code)
    countDown();
    while(!(P5IN & BIT2)) {
    // Wait for Up button to return to “normal”
    // Must re-read the input port
    // Not good code because loop could run forever
    }
    __delay_cycles(10000); // Again wait for debounce to end (again badcode)
    }
    return local;
    }

    void countUp(void)
    {
    P1OUT |= BIT0; // Set LED1 to indicate increment
    switch (currentState){
    case 0 :
    currentState = 1;
    P2OUT &= ~(BIT2 + BIT1);
    P2OUT |= (BIT0);
    break;
    case 1 :
    currentState = 2;
    P2OUT &= ~(BIT2 + BIT0);
    P2OUT |= (BIT1);
    break;
    case 2 :
    currentState = 3;
    P2OUT &= ~(BIT2);
    P2OUT |= (BIT1 + BIT0);
    break;
    case 3 :
    currentState = 4;
    P2OUT &= ~(BIT0 + BIT1);
    P2OUT |= (BIT2);
    break;
    case 4 :
    currentState = 5;
    P2OUT &= ~(BIT1);
    P2OUT |= (BIT2 + BIT0);
    break;
    case 5 :
    currentState = 6;
    P2OUT &= ~(BIT0);
    P2OUT |= (BIT2 + BIT1);
    break;
    case 6 :
    currentState = 7;
    P2OUT |= (BIT2 + BIT1 + BIT0);
    break;
    case 7 :
    currentState = 0;
    P2OUT &= ~(BIT2 + BIT1 + BIT0);
    break;
    }
    }

    void countDown(void)
    {
    P1OUT &= ~(BIT0); // Turn off LED1 to indicate decrement
    switch (currentState){
    case 2 :
    currentState = 1;
    P2OUT &= ~(BIT2 + BIT1);
    P2OUT |= (BIT0);
    break;
    case 3 :
    currentState = 2;
    P2OUT &= ~(BIT2 + BIT0);
    P2OUT |= (BIT1);
    break;
    case 4 :
    currentState = 3;
    P2OUT &= ~(BIT2);
    P2OUT |= (BIT1 + BIT0);
    break;
    case 5 :
    currentState = 4;
    P2OUT &= ~(BIT0 + BIT1);
    P2OUT |= (BIT2);
    break;
    case 6 :
    currentState = 5;
    P2OUT &= ~(BIT1);
    P2OUT |= (BIT2 + BIT0);
    break;
    case 7 :
    currentState = 6;
    P2OUT &= ~(BIT0);
    P2OUT |= (BIT2 + BIT1);
    break;
    case 0 :
    currentState = 7;
    P2OUT |= (BIT2 + BIT1 + BIT0);
    break;
    case 1 :
    currentState = 0;
    P2OUT &= ~(BIT2 + BIT1 + BIT0);
    break;
    }
    }

    /**
    * main.c
    */
    void main(void)
    {
    WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD; // stop watchdogtimer
    init(); // One time initialization function

    /*
    * The main while loop of the state machine will constantly scan theinputs
    * and update the system based on those inputs
    * This version of the code updates the LED’s on the buttonpress
    */
    while(1) {
    readS1Input(); // Check the S1 button
    readS2Input(); // Check the S2 button

    }
    }

    Expert Answer


    . . .


    view full answer
  • QUESTION : (Solved) : Code Used Encrypt Homework File Using Pseudo Random Number Generator Linear Congruence Ran Q27740341 . . .

    This code used to encrypt a homework file, using a pseudo-randomnumber generator (The Linear Congruence rand() Function inC), and I couldn’t figure out a way to know the seed, Iknow that the plaintext of the file is propably started withdocumentclass[12pt]{article}, and the encrypted file was created‎on 21/3/‎2018, ‏‎8:31:47 PM

    standard #de fine RAND MAX 32767 static unsigned long int next1; int rand (voidRAND MAX assumed to be 32767 next = next * 1103515245 + 12345; return (unsigned int) (next/65536) % 32768; void srand (unsigned int seed) next seed ; <stdio.h> <time.h> include include //Return a byte at a time of the rand () keystream char randchar) static int key: static int i-0 if (i-0) key rand ( ); return ((char ) (&key [i++ int main (int argc, const char argv) static char randstate [64] srand (time (NULL)) FILE *input, *output; inputfopen (Homeworklb.tex, r) output = fopen (Homework!b.tex.enc, int c,rc; while ((c fgetc (input))!-EOF) rc=randchar () ; printf (c %d (tc) and rc-%dn, c, c, rc) ; fputc (chrc,output) fclose (input) fclose (output)

    standard #de fine RAND MAX 32767 static unsigned long int next1; int rand (voidRAND MAX assumed to be 32767 next = next * 1103515245 + 12345; return (unsigned int) (next/65536) % 32768; void srand (unsigned int seed) next seed ; include include //Return a byte at a time of the rand () keystream char randchar) static int key: static int i-0 if (i-0) key rand ( ); return ((char ) (&key [i++ int main (int argc, const char argv) static char randstate [64] srand (time (NULL)) FILE *input, *output; inputfopen (“Homeworklb.tex”, “r”) output = fopen (“Homework!b.tex.enc”, int c,rc; while ((c fgetc (input))!-EOF) rc=randchar () ; printf (“c %d (tc) and rc-%dn”, c, c, rc) ; fputc (chrc,output) fclose (input) fclose (output) Show transcribed image text

    Expert Answer


    . . .


    view full answer
  • QUESTION : (Solved) : Code Usage Textpattern Inputfile Outputfile Executes Command Grep Textpattern Inputfile Q36160698 . . .

    1. Double Redirection In this portion of the recitation, you will be given nearly complete C code in rec08А.c that implements

    code:

    /*
    * usage: ./a.out text_pattern input_file output_file
    * Executes the command “grep text_pattern < input_file >output_file”
    */

    #include <stdio.h>
    #include <unistd.h>
    #include <fcntl.h>
    #include <sys/types.h>
    #include <sys/stat.h>

    int main(int argc, char **argv)
    {
       int ifp, ofp;

       if (argc == 4)
       {
           // grep on text_pattern
           char *grep_args[] = {“grep”,argv[1], NULL};

           // open input and outputfiles
           ifp = open(argv[2],O_RDONLY);
           ofp = open(argv[3], O_WRONLY |O_TRUNC | O_CREAT, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR);

           // duplicate input file tostdin
          

           // duplicate output file tostdout
          

           // close unused input filedescriptor
          
      
           // close unused output filedescriptor
      

           // execute grep
           execvp(“grep”, grep_args);
       }
       else
       {
           printf(“usage: %s text_patterninput_file output_filen”, argv[0]);
       }
    }

    1. Double Redirection In this portion of the recitation, you will be given nearly complete C code in rec08А.c that implements both input and output redirection. Specifically, your code will implement functionality executed by the following command: grep text pattern input file 〉 output file Your program is invoked with the following: /a.out text pattern input file output file All that is missing are four system calls for you to add beneath the applicable comments in the code. Follow the comment instructions to add the needed code, paying special attention to which file descriptor is being closed or duplicated SAMPLE OUTPUT (user input shown in bold green): $ more inputl.txt This life, which had been the tomb of his virtue and of his honour, is but a walking shadow: a poor player, that struts and frets his hour upon the stage, and then is heard no more: it is a tale told by an idiot, full of sound and fury, signifying nothing. William Shakespeare $ grep his outputl.txt $ more outputl.txt This life, which had been the tomb of his virtue and of his struts and frets his hour upon $ rm outputl.txt $ /a.out his inputl.txt outputi.txt ş more outputl.txt This ї¡fe, which had been the tomb of his virtue and of his struts and frets his hour upon Show transcribed image text 1. Double Redirection In this portion of the recitation, you will be given nearly complete C code in rec08А.c that implements both input and output redirection. Specifically, your code will implement functionality executed by the following command: grep text pattern input file 〉 output file Your program is invoked with the following: /a.out text pattern input file output file All that is missing are four system calls for you to add beneath the applicable comments in the code. Follow the comment instructions to add the needed code, paying special attention to which file descriptor is being closed or duplicated SAMPLE OUTPUT (user input shown in bold green): $ more inputl.txt This life, which had been the tomb of his virtue and of his honour, is but a walking shadow: a poor player, that struts and frets his hour upon the stage, and then is heard no more: it is a tale told by an idiot, full of sound and fury, signifying nothing. William Shakespeare $ grep his outputl.txt $ more outputl.txt This life, which had been the tomb of his virtue and of his struts and frets his hour upon $ rm outputl.txt $ /a.out his inputl.txt outputi.txt ş more outputl.txt This ї¡fe, which had been the tomb of his virtue and of his struts and frets his hour upon

    Expert Answer


    . . .


    view full answer