Generating list of patient tokens from a Prism cohort? - prism

When a Prim cohort is created, are the generated patient tokens automatically saved here (under the client is was generated for)?:
https://s3.console.aws.amazon.com/s3/buckets/kh-serenity-prod?region=us-west-2&prefix=serenity/cohort_lists/&showversions=false
And does a client_id = 0 here mean that there are no restrictions on who can view the cohort, ie a Komodo user account is enough to view the Prism cohort?

Related

Re-Ranking Algorithm for Anonymous Users

I have a website:
10,000 pages, each page represent a category, for example: "Laptops".
On each page I am showing 20 recommended products
99% of the users are anonymous
For each user I have a context (device, user-agent and category)
For each product I have the price and the seller name
I have 2 events: outbound & purchase
I would like to re-rank (re-order, sort) the results for each new anonymous user based on the user context. I would like to re-rank based on performance (outbound & purchase).
Do you have recommendation for Specific algorithm OR tool OR service to do that? I found AWS Personalize very nice but the problem is that all of my users are anonymous so I don't believe it can be effective in my use case.
Amazon Personalize can still be used effectively when most/all users are anonymous. If you track users as visitors using a cookie or local storage, then a visitor's session ID can be considered the userId in Personalize. You will lose the continuity of stitching together the same logical user's activity across multiple sessions but you can still get in-session personalization. This requires calling PutEvents with the visitor's session ID in the sessionId field and excluding the userId field. Then when calling the GetRecommendations or GetPersonalizedRanking APIs, use the visitor's session ID as the userId field. Personalize will consider the event activity for the visitor's session when providing recommendations or reranking items.
If the visitor is a known user or later becomes known (i.e. signs in or creates an account), then pass their user ID in the userId field for PutEvents and GetRecommendations/GetPersonalizedRanking. At the next training, Personalize will associate any prior anonymous events (i.e. those with a sessionId but not a userId) to the user. The key is using a consistent sessionId across the anonymous and known events for the user for the session.

Dynamics CRM Entity to be owned by person or company

I have the below requirement -
We have an entity named Garden. A garden is owned by a person or company, and can also be leased by one or more people or companies. Each garden has a unique number.
Ideally, we would want to be able to see a single grid of all the people that own and/or lease the garden, regardless of whether they are a person or a company.
Questions -
1) Which entity to choose for person -> User or Contact
2) Which entity to choose for company?
3) How to design record ownership or leasing of garden?
This is a broad question, I’ll try my best.
Fact: We don’t have an option today to create a custom polymorphic entity - to capture/store multiple types of entities. There are some available OOB entities - Customer to store Account/Contact, Owner to store User/Team, Activity Regarding to store any Activity enabled entities.
If you look at Bookable Resource entity, even MS store the type like User or Equipment & respective lookup records separately. This is what you need exactly. Read more
1) Which entity to choose for person -> User or Contact
2) Which entity to choose for company?
User (owner) in case you need security around the ownership of the records. Then company has to be the Teams, because you mentioned Garden maybe owned by Person or Company. How many records you’re going to manage and are they going to get login in CRM?
You may have to look at PowerApps (Dynamics) portals which gives B2B, B2C options to control records ownership by Accounts/Contacts.
3) How to design record ownership or leasing of garden?
Partially answered in the above points. For leasing, you can have multiple subgrid (1:N) relationship. If required, you may need a custom component or web resource to pull the multiple type of owned/leasing records by UNION the results & render as a grid.

Implementing a mini social graph

I have an application where users of the application can have many contacts ( other users of the application ) related to them. I would like to maintain a relation between a single user and its set of contacts. At any given point of time, I do NOT need to know anything more than the direct set of contacts for a particular user, i.e, contacts of contact of a particular user is not of relevance in this application.
Any suggestion on how to organise this data within the database? Please note that the number of users could go up really high.
Just to add some extra info, the database I am using right now is Mongodb and language being used is Ruby.
The only model right now before thinking of building all these relations is the Users model which stores details of each user registered onto the application. Now as I mentioned above, I need to built the specified relation between the user and its set of contacts. Any help would be highly appreciated.

MVC3 User Authentication link

In my application I have an administrator who can create Tournament objects. When the object is created the service also creates a user (based on the tournament director's info which was entered at creation). The username for the user is the director's e-mail, the password is randomly generated and then mailed to the director.
When the director logs on with his e-mail address and password, I need to be able to link him to his own tournament, in order to only allow him to edit his own tournament's details. I have tried to find a way to store the TournamentId in the default ASP Net Users database, but was unsuccessful.
I had a look at this SO question which would certainly help me, but I can't figure out how it would apply to my problem. When the user logs on, I can't put the TournamentId in the userdata seeing as I don't know it.
Should I then do a lookup in the Tournament table to see which ID corresponds to the email address entered at login and store that in the userData? It seems quite unelegant this way.
I guess you should have a CreatedBy column in your Tournament table where you store the ID of the user who created the tournament. Then when the user logged in, get his id ( may be from session ,if you store it there), Do a select query where CreatedBy=loggedInUserId .That should do the trick.

MVC 3 Basic Custom Membership

I am going to try and tackle this Membership system 1 little step at a time...
So, let's say that:
Step 1, I create an SQL database and in that database I have a Users table, very basic, that looks like this:
Users
UserID int, identity, primary key
UserName nvarchar(25)
UserPassword nvarchar (25)
UserEmail nvarchar (75)
Step 2, I create a new ASP.NET MVC3 Web Application
Step 3, I select the Internet Application template with the Razor view engine and check Use HTML 5 semantic markup
Step 4, I add an ADO.NET Entity Data Model
Step 5, In the Entity Data Model Wizard, I choose to Generate from database
Step 6, I select my data connection and select to Save entity connection settings in Web.Config
Step 7, In the Entity Data Model Wizard ==> Choose Your Database Objects, I put a check in Tables and leave the default checks in "Pluralize or singularize generated object names" and "Include foreign key columns in the model" and click Finish
Step 8, I Build Solution
Step 9, I right click in the .edmx file and choose to "Add Code Generation Item..."
Step 10, I add a new ADO.NET DbContext Generator (This then creates all of the table models)
OK, so this is where I don't know how to go any further with using the built-in Account/Membership system with my Users table. For right now, for this particular project anyway, I don't need Roles and what-not, just the [authorize] functionality...
So, what exactly, verbatim compliance, do I need to do in order for when a user comes to the website and registers or logs in, for the application to use my Users table? Ultimately so that when a user does log in, the [authorize] decoration will work for my user base.
EDIT: Thanks to olivehour ... The following changes, additions really, to make this work...
After Step 10: (side note: remove the UserPassword from your Users table, you won't need it)
Step 11, Run the aspnet_regsql.exe tool to add ASP.NET's tables to your database.
Step 12, Open up your Web.config file, copy just the "data source" information from your EntityFramework connectionString, then paste and replace the "ApplicationServices" connectionString "data source" with that of the EntityFramework's.
Step 13, In the Solution Explorer, right click on the Controller directory and Add Controller. At this point go ahead and add your UserController
Step 14, In the AccountController, in the [HttpPost] Register action method, inside of the "if (createStatus == MembershipCreateStatus.Success)" statement, add the following:
TheNameOfYourEntities db = new TheNameOfYourEntities();
User user = new TheNameOfYourProject.User();
user.UserName = model.UserName;
user.UserEmail = model.Email;
db.Users.Add(user);
db.SaveChanges();
Step 15, Build Solution, Save All, Run
We keep the built-in membership provider separate from our application users table.
I suggest using the built-in membership provider to handle user authentication. There are some settings that require you to make some decisions. For example, what will the username be? Do you want to allow email addresses as usernames? If so, you should set the requiresUniqueEmail to true on the provider element in web.config. (We make the user's email address their username. This simplifies things a lot.)
As for your custom Users table that you created using EF, don't use that for login. Use it to store application-specific information about your users. But, give rows in the table the same primary key value as the username in the membership provider db.
So, if a user registers with email address olivehour#stackoverflow.com, you would first do Membership.CreateUser to add them to the provider db, and in the same action, add a row to your users table with a primary key of olivehour#stackoverflow.com.
This way you never have to store any password encryption values in your database... you outsource it to the membership provider. When a user signs in, FormsAuthentication will write a cookie to maintain the login status. In a controller action, you can get the username with the code User.Identity.Name. Use that value as a parameter to select rows from your custom application-specific users table.

Resources